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, labelKey
 
Constructor Summary
MustOccurConstraint()
           
 
Method Summary
 String getLabelKey()
          LabelKey should be a single word key.
 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, getValidationMessageParams, getValidationMessageParamsArray, setApplyClientSide, setLabelKey, 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)

getLabelKey

public String getLabelKey()
Description copied from class: BaseConstraint
LabelKey should be a single word key. This key is used to find a message to use for this constraint from available messages. The key is also used for defining/retrieving validation method names when applicable for ValidCharactersContraints. If a comma separated list of keys is used, a message will be generated that is a comma separated list of the messages retrieved for each key.

Overrides:
getLabelKey in class BaseConstraint
Returns:
See Also:
ValidCharactersConstraint


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