Interface ParameterEvaluator
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AlwaysSucceedParameterEvaluatorImpl,ParameterEvaluatorImpl
public interface ParameterEvaluator extends Serializable
This is a stateful wrapper for Parameters, which provides convenient methods to evaluate a constrained value against a Parameter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanconstraintIsAllow()This method determines whether the parameter lists allowed values or denied values.booleanevaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass, String constrainedPropertyName)This method uses the evaluateAndAddError method.booleanevaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass, String constrainedPropertyName, String userEditablePropertyName)This method uses the evaluationSucceeds method to evaluate the constrainedValue.booleanevaluationSucceeds()This method determines whether the constrainedValue specified when the ParameterEvaluator was created matches the parameter.StringgetParameterValuesForMessage()This method creates a pretty String representation of parameter values for the user messages.StringgetValue()This method returns the value of the correspnding Parameter.
-
-
-
Method Detail
-
evaluationSucceeds
boolean evaluationSucceeds()
This method determines whether the constrainedValue specified when the ParameterEvaluator was created matches the parameter.- Returns:
- boolean indicating whether the constrained value adheres to the restriction specified by the combination of the parameter constraint and the parameter value
-
evaluateAndAddError
boolean evaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass, String constrainedPropertyName)
This method uses the evaluateAndAddError method. It passes the constrainedPropertyName as both the constrainedPropertyName and the userEditablePropertyName, i.e. it should be used when they are one and the same.- Parameters:
businessObjectOrDocumentClass-constrainedPropertyName-- Returns:
- boolean indicating whether evaluation succeeded (see evaluationSucceeds)
-
evaluateAndAddError
boolean evaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass, String constrainedPropertyName, String userEditablePropertyName)
This method uses the evaluationSucceeds method to evaluate the constrainedValue. If evaluation does not succeed, it adds an error for the user. The businessObjectOrDocumentClass, nameOfConstrainedProperty and userEditablePropertyName are used by ParameterEvaluatorImpl to retrieve user friendly labels for the error message. The constrainedPropertyName corresponds to the field that has the value that the parameter is evaluating. The userEditablePropertyName corresponds to the field that has the value the user needs to correct to resolve the error. For example, the object type may be invalid, but the user needs to change the object code in order to remedy that.- Parameters:
businessObjectOrDocumentClass-userEditableFieldToHighlight-nameOfconstrainedProperty-- Returns:
- boolean indicating whether evaluation succeeded (see evaluationSucceeds)
-
constraintIsAllow
boolean constraintIsAllow()
This method determines whether the parameter lists allowed values or denied values.- Returns:
- boolean indicating whether the parameter lists allowed values
-
getParameterValuesForMessage
String getParameterValuesForMessage()
This method creates a pretty String representation of parameter values for the user messages.- Returns:
- user-friendly String representation of Parameter values
-
getValue
String getValue()
This method returns the value of the correspnding Parameter.- Returns:
- String value of underlying Parameter
-
-