Class BaseConstraint
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,Constraint
- Direct Known Subclasses:
CaseConstraint,MustOccurConstraint,PrerequisiteConstraint,SimpleConstraint,ValidCharactersConstraint
- Since:
- 1.1
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Booleanprotected List<? extends BaseConstraint> protected Stringprotected Stringprotected StringFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
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.If this is true, the constraint should be applied on the client side when the user interacts with a field - if this constraint can be interpreted for client side use.List<? extends BaseConstraint> Get the list of constraintStateOverrides which represent constraints that will replace THIS constraint when their state is matched during validation.A code within the namespace that identifies a component or group the constraint message is associated withA key that is used to retrieve the constraint message text (used with the namespace and component code if specified)Namespace code (often an application or module code) the constraint failure message is associated withA list of states to apply this constraint for, this will effect when a constraint is applied.Parameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the paramString[]Parameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the paramvoidsetApplyClientSide(Boolean applyClientSide) voidsetConstraintStateOverrides(List<? extends BaseConstraint> constraintStateOverrides) Set the constraintStateOverrides to be used when a state is matched during validationvoidsetMessageComponentCode(String messageComponentCode) Setter for the constraint message associated component codevoidsetMessageKey(String messageKey) Setter for the constraint message keyvoidsetMessageNamespaceCode(String messageNamespaceCode) Setter for the constraint message associated namespace codevoidSet the states for this contraint to be applied onvoidsetValidationMessageParams(List<String> validationMessageParams) Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
-
Field Details
-
messageNamespaceCode
-
messageComponentCode
-
messageKey
-
applyClientSide
-
validationMessageParams
-
states
-
constraintStateOverrides
-
-
Constructor Details
-
BaseConstraint
public BaseConstraint()
-
-
Method Details
-
getMessageNamespaceCode
Namespace code (often an application or module code) the constraint failure message is associated withUsed with the component code and error key for retrieving the constraint. If null, the default namespace code will be used
- Returns:
- String constraint message namespace code
-
setMessageNamespaceCode
Setter for the constraint message associated namespace code- Parameters:
messageNamespaceCode-
-
getMessageComponentCode
A code within the namespace that identifies a component or group the constraint message is associated withUsed with the namespace and error key for retrieving the constraint text. If null, the default component code will be used
- Returns:
- String message component code
-
setMessageComponentCode
Setter for the constraint message associated component code- Parameters:
messageComponentCode-
-
getMessageKey
A key that is used to retrieve the constraint message text (used with the namespace and component code if specified)- Returns:
- String message key
-
setMessageKey
Setter for the constraint message key- Parameters:
messageKey-
-
getApplyClientSide
If this is true, the constraint should be applied on the client side when the user interacts with a field - if this constraint can be interpreted for client side use. Default is true.- Returns:
- the applyClientSide
-
setApplyClientSide
- Parameters:
applyClientSide- the applyClientSide to set
-
getValidationMessageParams
Parameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the param- Returns:
- the validationMessageParams
-
getValidationMessageParamsArray
Parameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the param- Returns:
- the validationMessageParams
-
setValidationMessageParams
- Parameters:
validationMessageParams- the validationMessageParams to set
-
getStates
A list of states to apply this constraint for, this will effect when a constraint is applied.Each state this constraint is applied for needs to be declared with few additional options:
- if NO states are defined for this constraint, this constraint is applied for ALL states
- if a state is defined with a + symbol, example "state+", then this constraint will be applied for that state and ALL following states
- if a state is defined as a range with ">", example "state1>state6", then this constraint will be applied for all states from state1 to state6
These can be mixed and matched, as appropriate, though states using a + symbol should always be the last item of a list (as they imply this state and everything else after).
Example state list may be: ["state1", "state3>state5", "state6+"]. In this example, note that this constraint is never applied to "state2" (assuming these example states represent a state order by number)
- Returns:
- the states to apply the constraint on, an empty list if the constraint is applied for all states
-
setStates
Set the states for this contraint to be applied on- Parameters:
states-
-
getConstraintStateOverrides
Get the list of constraintStateOverrides which represent constraints that will replace THIS constraint when their state is matched during validation. Because of this, constraints added to this list MUST have their states defined.ConstraintStateOverrides always take precedence over this constraint if they apply to the state being evaluated during validation. These settings have no effect if there is no stateMapping represented on the entry/view being evaluated.
- Returns:
- List of constraint overrides for this constraint
-
setConstraintStateOverrides
Set the constraintStateOverrides to be used when a state is matched during validation- Parameters:
constraintStateOverrides-
-
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
-