Class RangeConstraintProcessor
java.lang.Object
org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor<RangeConstraint>
org.kuali.rice.krad.datadictionary.validation.processor.RangeConstraintProcessor
- All Implemented Interfaces:
ConstraintProcessor<Object,RangeConstraint>
RangeConstraintProcessor enforces range constraints - that is, constraints that keep a number or a date within a
specific range
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
Fields inherited from class org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor
dataDictionaryService, dateTimeService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? 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, RangeConstraint constraint, AttributeValueReader attributeValueReader) process the provided constraintprotected ConstraintValidationResultprocessSingleRangeConstraint(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) validates the value provided usingRangeConstraintprotected ConstraintValidationResultvalidateRange(DictionaryValidationResult result, Number value, RangeConstraint constraint, AttributeValueReader attributeValueReader) validates the number value using the range constraint providedprotected ConstraintValidationResultvalidateRange(DictionaryValidationResult result, Date value, RangeConstraint constraint, AttributeValueReader attributeValueReader) validates the date value using the range constraint providedMethods inherited from class org.kuali.rice.krad.datadictionary.validation.processor.MandatoryElementConstraintProcessor
getDataDictionaryService, getDateTimeService, isOptional, setDataDictionaryService, setDateTimeService
-
Constructor Details
-
RangeConstraintProcessor
public RangeConstraintProcessor()
-
-
Method Details
-
process
public ProcessorResult process(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException Description copied from interface:ConstraintProcessorprocess 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- See Also:
-
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:
-
processSingleRangeConstraint
protected ConstraintValidationResult processSingleRangeConstraint(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException validates the value provided usingRangeConstraint- Parameters:
result- - a holder for any already run validation resultsvalue- - the value to validateconstraint- - the range constraint to useattributeValueReader- - provides access to the attribute being validated- Returns:
- the passed in result, updated with the results of the processing
- Throws:
AttributeValidationException- if validation fails
-
validateRange
protected ConstraintValidationResult validateRange(DictionaryValidationResult result, Date value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws IllegalArgumentException validates the date value using the range constraint provided- Parameters:
result- - a holder for any already run validation resultsvalue- - the value to validateconstraint- - the range constraint to useattributeValueReader- - provides access to the attribute being validated- Returns:
- the passed in result, updated with the results of the processing
- Throws:
IllegalArgumentException
-
validateRange
protected ConstraintValidationResult validateRange(DictionaryValidationResult result, Number value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws IllegalArgumentException validates the number value using the range constraint provided- Parameters:
result- - a holder for any already run validation resultsvalue- - the value to validateconstraint- - the range constraint to useattributeValueReader- - provides access to the attribute being validated- Returns:
- the passed in result, updated with the results of the processing
- Throws:
IllegalArgumentException
-