Class WhenConstraint
java.lang.Object
org.kuali.rice.krad.datadictionary.validation.constraint.WhenConstraint
- All Implemented Interfaces:
Serializable,Constraint
WhenConstraint is a child of a CaseConstraint
It provides a specific additional constraint that should be processed when the condition itself is true.
So a case constraint on country, might have a when constraint with value='USA', and another with value='Canada'.
Each of these
WhenConstraint's would define a constraint of their own that would only be processed when the country was
USA, or when the country
was Canada.
A WhenConstraint either specifies an attribute path whose value it then provides or a constraint.
The parent @{CaseConstraint} is defined on the field on which the constraints are desired to take effect.
- Since:
- 1.1
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteValidation(ValidationTrace tracer) Validates different requirements of component compiling a series of reports detailing information on errors found in the component.The constraint to apply to the field when theWhenConstraintvalue/values matchgetValue()The value to check for this when constraint.Path that can retrieve an attributes valueList of values to check for this constraintvoidsetConstraint(Constraint constraint) setter for constraintvoidSets a single value to check for this constraint.voidsetValuePath(String valuePath) setter for the value pathvoidsetter for values
-
Field Details
-
values
-
valuePath
-
constraint
-
-
Constructor Details
-
WhenConstraint
public WhenConstraint()
-
-
Method Details
-
getValues
List of values to check for this constraint- Returns:
- a list of values for which to activate the associated constraint
-
setValues
setter for values- Parameters:
values- - the values to set
-
getValue
The value to check for this when constraint. This is a convenience method that is the first value of the values array.- Returns:
- the first value checking on, otherwise null
-
setValue
Sets a single value to check for this constraint. This is a convenience method.- Parameters:
value- - a values for which to activate the associated constraint
-
getValuePath
Path that can retrieve an attributes value- Returns:
- a string representation of specifically which attribute (at some depth) is being accessed
-
setValuePath
setter for the value path- Parameters:
valuePath- - the value path to set
-
getConstraint
The constraint to apply to the field when theWhenConstraintvalue/values match- Returns:
- the constraint
-
setConstraint
setter for constraint- Parameters:
constraint- - the constraint to set
-
completeValidation
Validates different requirements of component compiling a series of reports detailing information on errors found in the component. Used by the RiceDictionaryValidator.- Parameters:
tracer- Record of component's location
-