pt.digitalis.dif.dem.objects.parameters.constraints.impl
Class ParameterConstraintMaxSizeImpl

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

public class ParameterConstraintMaxSizeImpl
extends AbstractParameterConstraint

Max parameter constraint implementation

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

Constructor Summary
ParameterConstraintMaxSizeImpl()
           
 
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 isSupportedClass(Class<?> clazz)
          Checks if the parameter attribute is of a supported class for this constraint to be used
 boolean validateConstraint(String value, IStageInstance stageInstance)
          Validates the parameter value passed as a String
 
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

ParameterConstraintMaxSizeImpl

public ParameterConstraintMaxSizeImpl()
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()

isSupportedClass

public boolean isSupportedClass(Class<?> clazz)
Description copied from interface: IParameterConstraint
Checks if the parameter attribute is of a supported class for this constraint to be used

Parameters:
clazz - the class of the attribute on witch the constraint has been applied
Returns:
T is it is a supported class
See Also:
IParameterConstraint.isSupportedClass(java.lang.Class)

validateConstraint

public boolean validateConstraint(String value,
                                  IStageInstance stageInstance)
Description copied from interface: IParameterConstraint
Validates the parameter value passed as a String

Parameters:
value - the value to validate
stageInstance - the current stage in execution
Returns:
T if the validation succeded
See Also:
IParameterConstraint.validateConstraint(java.lang.String, pt.digitalis.dif.dem.interfaces.IStageInstance)


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