pt.digitalis.dif.dem.objects.parameters.constraints.impl.numeric
Class ParameterConstraintMaxImpl

java.lang.Object
  extended by pt.digitalis.dif.dem.objects.parameters.constraints.AbstractParameterConstraint
      extended by pt.digitalis.dif.dem.objects.parameters.constraints.impl.numeric.AbstractNumericParameterConstraint
          extended by pt.digitalis.dif.dem.objects.parameters.constraints.impl.numeric.ParameterConstraintMaxImpl
All Implemented Interfaces:
IParameterConstraint

public class ParameterConstraintMaxImpl
extends AbstractNumericParameterConstraint

Max parameter constraint implementation

Author:
Pedro Viegas pviegas@digitalis.pt
Created on:
Nov 16, 2007

Constructor Summary
ParameterConstraintMaxImpl()
           
 
Method Summary
 void configureConstraint(String configurationString)
          Configures the constraint.
protected  Map<String,String> getErrorMessageValues(boolean parseValues)
          Compiles all values to be parsed in the error message to be generated on request
 String getJavaScriptValidationCondition()
          Builds a JavaScript boolean expression to check this constraint.
 boolean validateConstraint(Double value, IStageInstance stageInstance)
          Validate method with the value converted to a Double
 
Methods inherited from class pt.digitalis.dif.dem.objects.parameters.constraints.impl.numeric.AbstractNumericParameterConstraint
isSupportedClass, validateConstraint
 
Methods inherited from class pt.digitalis.dif.dem.objects.parameters.constraints.AbstractParameterConstraint
getErrorIDs, getMessages, getValidationResult, validateConstraint, validationErrorMessage, validationErrorMessage, validationErrorMessage, validationErrorMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterConstraintMaxImpl

public ParameterConstraintMaxImpl()
Method Detail

configureConstraint

public void configureConstraint(String configurationString)
Description copied from interface: IParameterConstraint
Configures the constraint. Optional. The maximum value for max, or maskString for mask.

See Also:
IParameterConstraint.configureConstraint(java.lang.String)

getErrorMessageValues

protected Map<String,String> getErrorMessageValues(boolean parseValues)
Description copied from class: AbstractParameterConstraint
Compiles all values to be parsed in the error message to be generated on request

Specified by:
getErrorMessageValues in class AbstractParameterConstraint
Parameters:
parseValues - if T will replace the current parameter value in the message. Otherwise return the untouched message for custom parsing
Returns:
the list of key/values to replace in the error message
See Also:
AbstractParameterConstraint.getErrorMessageValues(boolean)

getJavaScriptValidationCondition

public String getJavaScriptValidationCondition()
Description copied from interface: IParameterConstraint
Builds a JavaScript boolean expression to check this constraint. Will assume there is a "value" variable with the current parameter value in context to get the parameter value from.

Returns:
the JS code to validate
See Also:
IParameterConstraint.getJavaScriptValidationCondition()

validateConstraint

public boolean validateConstraint(Double value,
                                  IStageInstance stageInstance)
Description copied from class: AbstractNumericParameterConstraint
Validate method with the value converted to a Double

Specified by:
validateConstraint in class AbstractNumericParameterConstraint
Parameters:
value - the value to compare
stageInstance - the current stage in execution
Returns:
T if the constraint is valid
See Also:
AbstractNumericParameterConstraint.validateConstraint(java.lang.Double, pt.digitalis.dif.dem.interfaces.IStageInstance)


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