org.kuali.rice.krad.datadictionary.validation.constraint.provider
Interface ConstraintProvider<T extends Constrainable>

All Known Implementing Classes:
AttributeDefinitionConstraintProvider, BaseConstraintProvider, CollectionDefinitionConstraintProvider, ComplexAttributeDefinitionConstraintProvider, DataObjectEntryConstraintProvider

public interface ConstraintProvider<T extends Constrainable>

ConstraintProvider determines a list of constraints for a given Constrainable definition for an attribute in the data dictionary

The ConstraintProvider interface must be implemented by any class that contributes Constraints to the DictionaryValidationService. Multiple ConstraintProviders can be registered simultaneously, and each can contribute constraints for any number of constraint types.

These constraints can be looked up in a variety of ways. They may be:

  1. member variables of the Constrainable definition itself CaseConstrainable.class
  2. the Constrainable definition itself may extend Constraint LengthConstrainable.class
  3. provided from some external source, or generated on the fly

The goal here is to provide a mechanism that enables implementing institutions to inject new Constraints and ConstraintProcessor classes into the DictionaryValidationService implementation via dependency injection.

Since:
1.1
Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 List<Constraint> getConstraints(T definition, Class<? extends Constraint> constraintType)
          gets the constraints provided
 boolean isSupported(Constrainable definition)
          checks whether this provider supports the provided definition
 

Method Detail

getConstraints

List<Constraint> getConstraints(T definition,
                                Class<? extends Constraint> constraintType)
gets the constraints provided

Parameters:
definition - - a Data Dictionary definition e.g. ComplexAttributeDefinition or CollectionDefinition
constraintType - - a java class that represents the constraint
Returns:
the list of constraints

isSupported

boolean isSupported(Constrainable definition)
checks whether this provider supports the provided definition

Parameters:
definition - - a Data Dictionary definition e.g. AttributeDefinition
Returns:
true if supported, false otherwise


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.