org.kuali.rice.krad.datadictionary.validation.processor
Interface ConstraintProcessor<T,C extends Constraint>
- All Known Subinterfaces:
- CollectionConstraintProcessor<T,C>
- All Known Implementing Classes:
- BasePrerequisiteConstraintProcessor, CaseConstraintProcessor, CollectionSizeConstraintProcessor, DataTypeConstraintProcessor, ExistenceConstraintProcessor, LengthConstraintProcessor, MandatoryElementConstraintProcessor, MustOccurConstraintProcessor, OptionalElementConstraintProcessor, PrerequisiteConstraintProcessor, RangeConstraintProcessor, ValidCharactersConstraintProcessor
public interface ConstraintProcessor<T,C extends Constraint>
This interface must be implemented by constraint processors, which validate individual constraints in the
data dictionary. The idea is that each constraint has its own processor, and that the validation service can be configured
via dependency injection with a list of processors. This gives institutions the ability to easily modify how validation
should be handled and to add arbitrary new constraints and constraint processors. An alternative might have been to put
the process() method into the Constraint marker interface and have each Constraint define its own processing, but that would
have forced business logic into what are naturally API classes (classes that implement Constraint). This strategy separates
the two functions.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
process
ProcessorResult process(DictionaryValidationResult result,
T value,
C constraint,
AttributeValueReader attributeValueReader)
throws AttributeValidationException
- Throws:
AttributeValidationException
getName
String getName()
getConstraintType
Class<? extends Constraint> getConstraintType()
isOptional
boolean isOptional()
- This method return true if the processing of this constraint is something that can be opted out of by some pieces of code.
The only example of this in the version under development (1.1) is the existence constraint.
- Returns:
- true if this processor can be turned off by some pieces of code, false otherwise
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.