public class RangeConstraintProcessor extends MandatoryElementConstraintProcessor<RangeConstraint>
An attribute
that is RangeConstrainable will expose a minimum and maximum value, and these will be validated against the
passed
value in the code below.
dataDictionaryService, dateTimeService| Constructor and Description |
|---|
RangeConstraintProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends Constraint> |
getConstraintType()
gets the java class type of the constraint that this contraint processor handles
|
String |
getName()
gets a descriptive name of this constraint processor
|
ProcessorResult |
process(DictionaryValidationResult result,
Object value,
RangeConstraint constraint,
AttributeValueReader attributeValueReader)
process the provided constraint
|
protected ConstraintValidationResult |
processSingleRangeConstraint(DictionaryValidationResult result,
Object value,
RangeConstraint constraint,
AttributeValueReader attributeValueReader)
validates the value provided using
RangeConstraint |
protected ConstraintValidationResult |
validateRange(DictionaryValidationResult result,
Date value,
RangeConstraint constraint,
AttributeValueReader attributeValueReader)
validates the date value using the range constraint provided
|
protected ConstraintValidationResult |
validateRange(DictionaryValidationResult result,
Number value,
RangeConstraint constraint,
AttributeValueReader attributeValueReader)
validates the number value using the range constraint provided
|
getDataDictionaryService, getDateTimeService, isOptional, setDataDictionaryService, setDateTimeServicepublic RangeConstraintProcessor()
public ProcessorResult process(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException
ConstraintProcessorresult - - holds dictionary validation resultsvalue - - the value of the attributeconstraint - - the constraint to processattributeValueReader - - - provides access to the attribute being validatedAttributeValidationExceptionConstraintProcessor.process(org.kuali.rice.krad.datadictionary.validation.result.DictionaryValidationResult,
Object, org.kuali.rice.krad.datadictionary.validation.constraint.Constraint,
org.kuali.rice.krad.datadictionary.validation.AttributeValueReader)public String getName()
ConstraintProcessore.g. @see CollectionSizeConstraintProcessor.CONSTRAINT_NAME
public Class<? extends Constraint> getConstraintType()
ConstraintProcessorConstraintConstraintProcessor.getConstraintType()protected ConstraintValidationResult processSingleRangeConstraint(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException
RangeConstraintresult - - a holder for any already run validation resultsvalue - - the value to validateconstraint - - the range constraint to useattributeValueReader - - provides access to the attribute being validatedAttributeValidationException - if validation failsprotected ConstraintValidationResult validateRange(DictionaryValidationResult result, Date value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws IllegalArgumentException
result - - a holder for any already run validation resultsvalue - - the value to validateconstraint - - the range constraint to useattributeValueReader - - provides access to the attribute being validatedIllegalArgumentExceptionprotected ConstraintValidationResult validateRange(DictionaryValidationResult result, Number value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws IllegalArgumentException
result - - a holder for any already run validation resultsvalue - - the value to validateconstraint - - the range constraint to useattributeValueReader - - provides access to the attribute being validatedIllegalArgumentExceptionCopyright © 2005–2016 The Kuali Foundation. All rights reserved.