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

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

public class MustOccurConstraint
extends BaseConstraint

Must occur constraints are constraints that indicate some range of acceptable valid results. So a must occur constraint might indicate that between 1 and 3 prequisite constraints must be valid. For example, on a person object, it might be that one of three fields must be filled in: 1. username 2. email 3. phone number By imposing a must occur constraint on the person object iself, and setting three prequisite constraints below it, with a min of 1 and a max of 3, this requirement can be enforced. A more complicated example might be that a US address is only valid if it provides either: (a) a city and state, or (b) a postal code To enforce this, a single must occur constraint would have two children: (1) a prequisite constraint on postal code, and (2) a must occur constraint with two child prequisite constraints, on city and state, respectively. By setting min=1/max=2 at the top must occur constraint, and min=2/max=2 at the leaf constraint, this requirement can be enforced.

Since:
1.1
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
applyClientSide, constraintStateOverrides, labelKey, states, validationMessageParams
 
Constructor Summary
MustOccurConstraint()
           
 
Method Summary
 Integer getMax()
           
 Integer getMin()
           
 List<MustOccurConstraint> getMustOccurConstraints()
           
 List<PrerequisiteConstraint> getPrerequisiteConstraints()
           
 void setMax(Integer max)
           
 void setMin(Integer min)
           
 void setMustOccurConstraints(List<MustOccurConstraint> occurs)
           
 void setPrerequisiteConstraints(List<PrerequisiteConstraint> prerequisiteConstraints)
           
 
Methods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
getApplyClientSide, getConstraintStateOverrides, getLabelKey, getStates, getValidationMessageParams, getValidationMessageParamsArray, setApplyClientSide, setConstraintStateOverrides, setLabelKey, setStates, setValidationMessageParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MustOccurConstraint

public MustOccurConstraint()
Method Detail

getPrerequisiteConstraints

public List<PrerequisiteConstraint> getPrerequisiteConstraints()

setPrerequisiteConstraints

public void setPrerequisiteConstraints(List<PrerequisiteConstraint> prerequisiteConstraints)

getMustOccurConstraints

public List<MustOccurConstraint> getMustOccurConstraints()

setMustOccurConstraints

public void setMustOccurConstraints(List<MustOccurConstraint> occurs)

getMin

public Integer getMin()

setMin

public void setMin(Integer min)

getMax

public Integer getMax()

setMax

public void setMax(Integer max)


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