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

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

public class DatePatternConstraint
extends ValidDataPatternConstraint

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:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint
value
 
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
applyClientSide, labelKey
 
Constructor Summary
DatePatternConstraint()
           
 
Method Summary
 List<String> getAllowedFormats()
           
protected  String getRegexString()
          Returns a regex representing all the allowed formats in the system.
 List<String> getValidationMessageParams()
          This overridden method ...
 void setAllowedFormats(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 format
 
Methods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.ValidDataPatternConstraint
getValue, setValue
 
Methods inherited from class org.kuali.rice.krad.datadictionary.validation.constraint.BaseConstraint
getApplyClientSide, getLabelKey, getValidationMessageParamsArray, setApplyClientSide, setLabelKey, setValidationMessageParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatePatternConstraint

public DatePatternConstraint()
Method Detail

getRegexString

protected String 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:
getRegexString in class ValidDataPatternConstraint
See Also:
ValidDataPatternConstraint.getRegexString()

getAllowedFormats

public List<String> getAllowedFormats()
Returns:
the allowedFormats

setAllowedFormats

public void setAllowedFormats(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 format

Parameters:
allowedFormats - the allowedFormats to set

getValidationMessageParams

public List<String> getValidationMessageParams()
This overridden method ...

Overrides:
getValidationMessageParams in class BaseConstraint
Returns:
the validationMessageParams
See Also:
BaseConstraint.getValidationMessageParams()


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