Class ValidCharactersConstraintProcessor
java.lang.Object
org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor<ValidCharactersConstraint>
org.kuali.rice.krad.datadictionary.validation.processor.ValidCharactersConstraintProcessor
- All Implemented Interfaces:
ConstraintProcessor<Object,ValidCharactersConstraint>
public class ValidCharactersConstraintProcessor
extends MandatoryElementConstraintProcessor<ValidCharactersConstraint>
This class defines a constraint processor to ensure that attribute values are constrained to valid characters, as
defined by some regular expression. Of the
constraint processors written for this version, this one is potentially the most difficult to understand because it
holds on to a lot of legacy processing.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsFields inherited from class org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor
dataDictionaryService, dateTimeService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConstraintValidationResultdoProcessFormattableValidCharConstraint(DictionaryValidationResult result, ValidCharactersConstraint validCharsConstraint, Formatable definition, Object value, AttributeValueReader attributeValueReader) protected ConstraintValidationResultdoProcessValidCharConstraint(ValidCharactersConstraint validCharsConstraint, Object value) Class<? extends Constraint> gets the java class type of the constraint that this contraint processor handlesgetName()gets a descriptive name of this constraint processorprocess(DictionaryValidationResult result, Object value, ValidCharactersConstraint constraint, AttributeValueReader attributeValueReader) process the provided constraintprotected ConstraintValidationResultprocessFormatterValidation(DictionaryValidationResult result, Class<?> formatterClass, String entryName, String attributeName, String parsedAttributeValue, String errorKeyPrefix) protected ConstraintValidationResultprocessSingleValidCharacterConstraint(DictionaryValidationResult result, Object value, ValidCharactersConstraint constraint, AttributeValueReader attributeValueReader) protected ConstraintValidationResultvalidateDateOrder(String firstDateTime, String secondDateTime, String entryName, String attributeName) Methods inherited from class org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor
getDataDictionaryService, getDateTimeService, isOptional, setDataDictionaryService, setDateTimeService
-
Field Details
-
VALIDATE_METHOD
- See Also:
-
-
Constructor Details
-
ValidCharactersConstraintProcessor
public ValidCharactersConstraintProcessor()
-
-
Method Details
-
process
public ProcessorResult process(DictionaryValidationResult result, Object value, ValidCharactersConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException process the provided constraint- Parameters:
result- - holds dictionary validation resultsvalue- - the value of the attributeconstraint- - the constraint to processattributeValueReader- - - provides access to the attribute being validated- Returns:
- the result of the constraint processing
- Throws:
AttributeValidationException
-
getName
Description copied from interface:ConstraintProcessorgets a descriptive name of this constraint processore.g. @see CollectionSizeConstraintProcessor.CONSTRAINT_NAME
- Returns:
- a descriptive name
-
getConstraintType
Description copied from interface:ConstraintProcessorgets the java class type of the constraint that this contraint processor handles- Returns:
- an instance of
Constraint - See Also:
-
processSingleValidCharacterConstraint
protected ConstraintValidationResult processSingleValidCharacterConstraint(DictionaryValidationResult result, Object value, ValidCharactersConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException - Throws:
AttributeValidationException
-
doProcessFormattableValidCharConstraint
protected ConstraintValidationResult doProcessFormattableValidCharConstraint(DictionaryValidationResult result, ValidCharactersConstraint validCharsConstraint, Formatable definition, Object value, AttributeValueReader attributeValueReader) throws AttributeValidationException - Throws:
AttributeValidationException
-
doProcessValidCharConstraint
protected ConstraintValidationResult doProcessValidCharConstraint(ValidCharactersConstraint validCharsConstraint, Object value) -
processFormatterValidation
protected ConstraintValidationResult processFormatterValidation(DictionaryValidationResult result, Class<?> formatterClass, String entryName, String attributeName, String parsedAttributeValue, String errorKeyPrefix) -
validateDateOrder
protected ConstraintValidationResult validateDateOrder(String firstDateTime, String secondDateTime, String entryName, String attributeName)
-