org.kuali.rice.krad.datadictionary.validation.constraint
Class WhenConstraint

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.validation.constraint.WhenConstraint
All Implemented Interfaces:
Serializable, Constraint

public class WhenConstraint
extends Object
implements 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:
Serialized Form

Field Summary
protected  Constraint constraint
           
protected  String valuePath
           
protected  List<Object> values
           
 
Constructor Summary
WhenConstraint()
           
 
Method Summary
 Constraint getConstraint()
          gets the constraint to apply to the field when the WhenConstraint value/values match
 String getValuePath()
          gets a path that can retrieve an attributes value
 List<Object> getValues()
          gets the list of values defined for this constraint
 void setConstraint(Constraint constraint)
          setter for constraint
 void setValue(Object value)
          gets the value defined for this constraint
 void setValuePath(String valuePath)
          setter for the value path
 void setValues(List<Object> values)
          setter for values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected List<Object> values

valuePath

protected String valuePath

constraint

protected Constraint constraint
Constructor Detail

WhenConstraint

public WhenConstraint()
Method Detail

getValues

public List<Object> getValues()
gets the list of values defined for this constraint

Returns:
a list of values for which to activate the associated constraint

setValues

public void setValues(List<Object> values)
setter for values

Parameters:
values - - the values to set

setValue

public void setValue(Object value)
gets the value defined for this constraint

Parameters:
value - - a values for which to activate the associated constraint

getValuePath

public String getValuePath()
gets a path that can retrieve an attributes value

Returns:
a string representation of specifically which attribute (at some depth) is being accessed

setValuePath

public void setValuePath(String valuePath)
setter for the value path

Parameters:
valuePath - - the value path to set

getConstraint

public Constraint getConstraint()
gets the constraint to apply to the field when the WhenConstraint value/values match

Returns:

setConstraint

public void setConstraint(Constraint constraint)
setter for constraint

Parameters:
constraint - - the constraint to set


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.