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, setDateTimeService
public RangeConstraintProcessor()
public ProcessorResult process(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException
ConstraintProcessor
result
- - holds dictionary validation resultsvalue
- - the value of the attributeconstraint
- - the constraint to processattributeValueReader
- - - provides access to the attribute being validatedAttributeValidationException
ConstraintProcessor.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()
ConstraintProcessor
e.g. @see CollectionSizeConstraintProcessor.CONSTRAINT_NAME
public Class<? extends Constraint> getConstraintType()
ConstraintProcessor
Constraint
ConstraintProcessor.getConstraintType()
protected ConstraintValidationResult processSingleRangeConstraint(DictionaryValidationResult result, Object value, RangeConstraint constraint, AttributeValueReader attributeValueReader) throws AttributeValidationException
RangeConstraint
result
- - a holder for any already run validation resultsvalue
- - the value to validateconstraint
- - the range constraint to useattributeValueReader
- - provides access to the attribute being validatedAttributeValidationException
protected 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 validatedIllegalArgumentException
protected 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 validatedIllegalArgumentException
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.