pt.digitalis.dif.dem.objects.parameters.types
Class DoubleParameter

java.lang.Object
  extended by pt.digitalis.dif.dem.objects.parameters.types.AbstractParameter<Number>
      extended by pt.digitalis.dif.dem.objects.parameters.types.DoubleParameter
All Implemented Interfaces:
Cloneable, IEditableParameter, IParameter<Number>

public class DoubleParameter
extends AbstractParameter<Number>

This class will define a numeric Parameter.

It will hold information relative to the Parameter value, ID key and validation constraints.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gonçalves rgoncalves@digitalis.pt
Created on:
Nov 23, 2007

Constructor Summary
DoubleParameter()
           
 
Method Summary
protected  String automaticConstraints()
          To override in each parameter type class as needed
 List<String> getSupportedClasses()
           
 BigDecimal getValueAsBigDecimal(IDIFContext context)
           
 boolean getValueAsBoolean(IDIFContext context)
           
 Date getValueAsDate(IDIFContext context)
           
 Double getValueAsDouble(IDIFContext context)
           
 Long getValueAsLong(IDIFContext context)
           
 boolean isNumeric()
           
 ParameterErrorList setValueFromString(String value, IStageInstance stageInstance, boolean initializationInProgress)
          Sets the value of the parameter converting if from a string representation and runs all constraints and validations
 
Methods inherited from class pt.digitalis.dif.dem.objects.parameters.types.AbstractParameter
addRule, clone, convertObjectToString, forceInitialize, getConstraints, getFormLinked, getId, getLanguage, getMessages, getParameterScope, getParentID, getParentType, getRules, getValidators, getValue, getValueAsDocument, getValueAsString, hasFormBeenSubmited, hasValue, initialize, isAllowAnonymous, isFirstInitialization, isFormConfigurable, isPersistToRepository, isReadonly, isReferencedInARuleFromAnotherParameter, isRequired, isStringSetterSupported, logWarning, refreshParameterValue, setDefaultValue, setDefaultValue, setFirstInitialization, setFormConfigurable, setFormLinked, setReferencedInARuleFromAnotherParameter, setRequired, setValue, setValue, setValueFromString, toString, validateParameterValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleParameter

public DoubleParameter()
Method Detail

automaticConstraints

protected String automaticConstraints()
Description copied from class: AbstractParameter
To override in each parameter type class as needed

Overrides:
automaticConstraints in class AbstractParameter<Number>
Returns:
the list of automatic constraints that each parameter type adds
See Also:
AbstractParameter.automaticConstraints()

getSupportedClasses

public List<String> getSupportedClasses()
Returns:
the list of supported class types for the parameter value
See Also:
IParameter.getSupportedClasses()

getValueAsBigDecimal

public BigDecimal getValueAsBigDecimal(IDIFContext context)
                                throws ParameterException
Parameters:
context - the DIF context to read if needed
Returns:
the value of the parameter as a Double
Throws:
ParameterException - if a conversion error occurs
See Also:
IParameter.getValueAsBigDecimal(pt.digitalis.dif.controller.interfaces.IDIFContext)

getValueAsBoolean

public boolean getValueAsBoolean(IDIFContext context)
                          throws ParameterException
Parameters:
context - the DIF context to read if needed
Returns:
the value of the parameter as a boolean
Throws:
ParameterException - if the parameter value cannot be read
See Also:
IParameter.getValueAsBoolean(IDIFContext)

getValueAsDate

public Date getValueAsDate(IDIFContext context)
Parameters:
context - the DIF context to read if needed
Returns:
the value of the parameter as a Date
See Also:
IParameter.getValueAsDate(IDIFContext)

getValueAsDouble

public Double getValueAsDouble(IDIFContext context)
                        throws ParameterException
Parameters:
context - the DIF context to read if needed
Returns:
the value of the parameter as a Double
Throws:
ParameterException - if a conversion error occurs
See Also:
IParameter.getValueAsDouble(IDIFContext)

getValueAsLong

public Long getValueAsLong(IDIFContext context)
                    throws ParameterException
Parameters:
context - the DIF context to read if needed
Returns:
the value of the parameter as an Long
Throws:
ParameterException - if a conversion error occurs
See Also:
IParameter.getValueAsLong(IDIFContext)

isNumeric

public boolean isNumeric()
Returns:
T if the current parameter is of a numeric type
See Also:
IParameter.isNumeric()

setValueFromString

public ParameterErrorList setValueFromString(String value,
                                             IStageInstance stageInstance,
                                             boolean initializationInProgress)
Description copied from interface: IParameter
Sets the value of the parameter converting if from a string representation and runs all constraints and validations

Parameters:
value - the value to set
stageInstance - the DIF stage to read if needed.
initializationInProgress - T if called within the dif parameter initialization
Returns:
return the error messages if the validation fails
See Also:
IParameter.setValueFromString(java.lang.String, pt.digitalis.dif.dem.interfaces.IStageInstance, boolean)


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.