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

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

public class BooleanParameter
extends AbstractParameter<Boolean>

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
BooleanParameter()
           
 
Method Summary
 List<String> getSupportedClasses()
           
 Boolean getValue(IDIFContext context)
          Returns the parameter value.
 BigDecimal getValueAsBigDecimal(IDIFContext context)
           
 boolean getValueAsBoolean(IDIFContext context)
           
 Date getValueAsDate(IDIFContext context)
           
 Double getValueAsDouble(IDIFContext context)
           
 Long getValueAsLong(IDIFContext context)
           
 String getValueAsString(IDIFContext context)
          Returns the parameter value as a String
 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, automaticConstraints, clone, convertObjectToString, forceInitialize, getConstraints, getFormLinked, getId, getLanguage, getMessages, getParameterScope, getParentID, getParentType, getRules, getValidators, getValueAsDocument, 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

BooleanParameter

public BooleanParameter()
Method Detail

getSupportedClasses

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

getValue

public Boolean getValue(IDIFContext context)
                 throws ParameterException
Description copied from interface: IParameter
Returns the parameter value. This method will check a number of possible sources for the value of the parameter depending on it's scope and attributes.

Specified by:
getValue in interface IParameter<Boolean>
Overrides:
getValue in class AbstractParameter<Boolean>
Parameters:
context - the DIF context to read if needed
Returns:
the value
Throws:
ParameterException - if the parameter could not be read
See Also:
AbstractParameter.getValue(pt.digitalis.dif.controller.interfaces.IDIFContext)

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)

getValueAsString

public String getValueAsString(IDIFContext context)
                        throws ParameterException
Description copied from interface: IParameter
Returns the parameter value as a String

Specified by:
getValueAsString in interface IParameter<Boolean>
Overrides:
getValueAsString in class AbstractParameter<Boolean>
Parameters:
context - the DIF context to read if needed
Returns:
the string representation of the parameter value
Throws:
ParameterException - if the parameter value cannot be read
See Also:
AbstractParameter.getValueAsString(pt.digitalis.dif.controller.interfaces.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.