net.sf.oval.configuration.annotation
Class AnnotationsConfigurer
java.lang.Object
net.sf.oval.configuration.annotation.AnnotationsConfigurer
- All Implemented Interfaces:
- Configurer
public class AnnotationsConfigurer
- extends Object
- implements Configurer
Configurer that configures constraints based on annotations tagged with Constraint
- Author:
- Sebastian Thomschke
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
listeners
protected final Set<CheckInitializationListener> listeners
AnnotationsConfigurer
public AnnotationsConfigurer()
addCheckInitializationListener
public boolean addCheckInitializationListener(CheckInitializationListener listener)
configureConstructorParameterChecks
protected void configureConstructorParameterChecks(ClassConfiguration classCfg)
configureFieldChecks
protected void configureFieldChecks(ClassConfiguration classCfg)
configureMethodChecks
protected void configureMethodChecks(ClassConfiguration classCfg)
- configure method return value and parameter checks
configureObjectLevelChecks
protected void configureObjectLevelChecks(ClassConfiguration classCfg)
getClassConfiguration
public ClassConfiguration getClassConfiguration(Class<?> clazz)
- Returns the constraint configurations for the given class. This method
is invoked only once by the Validator, the very first time an object
of the given class needs to be validated. The constraint configuration
is then translated into an Validator internal format and cached.
- Specified by:
getClassConfiguration
in interface Configurer
- Parameters:
clazz
- the class to get the configuration for
- Returns:
- The constraint configurations for the given class.
getConstraintSetConfiguration
public ConstraintSetConfiguration getConstraintSetConfiguration(String constraintSetId)
- Returns the constraint configuration for the constraint set with the
given Id.
- Specified by:
getConstraintSetConfiguration
in interface Configurer
- Parameters:
constraintSetId
- the ID of the constraint set
- Returns:
- The constraint configuration for the constraint set with the given Id.
initializeCheck
protected <ConstraintAnnotation extends Annotation> AnnotationCheck<ConstraintAnnotation> initializeCheck(ConstraintAnnotation constraintAnnotation)
throws ReflectionException
- Throws:
ReflectionException
initializeChecks
protected <ConstraintsAnnotation extends Annotation> void initializeChecks(ConstraintsAnnotation constraintsAnnotation,
List<Check> checks)
throws ReflectionException
- Throws:
ReflectionException
initializeExclusion
protected <ExclusionAnnotation extends Annotation> AnnotationCheckExclusion<ExclusionAnnotation> initializeExclusion(ExclusionAnnotation exclusionAnnotation)
throws ReflectionException
- Throws:
ReflectionException
newCheckInstance
protected <ConstraintAnnotation extends Annotation> AnnotationCheck<ConstraintAnnotation> newCheckInstance(Class<AnnotationCheck<ConstraintAnnotation>> checkClass)
throws OValException
- Returns:
- a new instance of the given constraint check implementation class
- Throws:
OValException
removeCheckInitializationListener
public boolean removeCheckInitializationListener(CheckInitializationListener listener)
Copyright © 2005-2013 The OVal Development Team. All Rights Reserved.