Class DatePatternConstraint
java.lang.Object
org.kuali.rice.krad.datadictionary.DictionaryBeanBase
org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint
org.kuali.rice.krad.datadictionary.validation.constraint.ValidDataPatternConstraint
org.kuali.rice.krad.datadictionary.validation.constraint.DatePatternConstraint
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,Constraint
DatePatternConstraint constrains a field to only allow dates which are part of the formats
defined in the system. Constraining a field all these formats is often not appropriate for
fields, and you may want to constrain the input to a subset of the allowed formats in the system.
This can be done by setting the allowed formats to this subset (see BasicDatePatternConstraint
bean for example)
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint
valueFields inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
applyClientSide, constraintStateOverrides, messageComponentCode, messageKey, messageNamespaceCode, states, validationMessageParamsFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns a regex representing all the allowed formats in the system.Parameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the paramvoidsetAllowedFormats(List<String> allowedFormats) Sets the alloweFormats for this constraint, this must be a subset of the system configured formats for a date - this list should be used for most fields where you are expecting a user to enter a date in a specific formatMethods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.ValidDataPatternConstraint
getValue, setValueMethods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint
completeValidationMethods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
getApplyClientSide, getConstraintStateOverrides, getMessageComponentCode, getMessageKey, getMessageNamespaceCode, getStates, getValidationMessageParamsArray, setApplyClientSide, setConstraintStateOverrides, setMessageComponentCode, setMessageKey, setMessageNamespaceCode, setStates, setValidationMessageParamsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
clone, copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
-
Constructor Details
-
DatePatternConstraint
public DatePatternConstraint()
-
-
Method Details
-
getRegexString
Returns a regex representing all the allowed formats in the system. If allowedFormats is supplied, returns a regex representing only those formats.- Specified by:
getRegexStringin classValidDataPatternConstraint- Returns:
- regular expression
- See Also:
-
getAllowedFormats
- Returns:
- the allowedFormats
-
setAllowedFormats
Sets the alloweFormats for this constraint, this must be a subset of the system configured formats for a date - this list should be used for most fields where you are expecting a user to enter a date in a specific format- Parameters:
allowedFormats- the allowedFormats to set
-
getValidationMessageParams
Description copied from class:BaseConstraintParameters to be used in the string retrieved by this constraint's messageKey, ordered by number of the param- Overrides:
getValidationMessageParamsin classBaseConstraint- Returns:
- the validationMessageParams
-