org.apache.bval.jsr303
Class AnnotationProcessor

java.lang.Object
  extended by org.apache.bval.jsr303.AnnotationProcessor

public final class AnnotationProcessor
extends Object

Description: implements uniform handling of JSR303 Constraint annotations, including composed constraints and the resolution of ConstraintValidator implementations.

Version:
$Rev: 996992 $ $Date: 2010-09-14 12:05:40 -0500 (Tue, 14 Sep 2010) $

Constructor Summary
AnnotationProcessor(ApacheFactoryContext factoryContext)
          Create a new AnnotationProcessor instance.
 
Method Summary
 boolean addAccessStrategy(MetaProperty prop, AccessStrategy access)
          Add the specified AccessStrategy to prop; noop if prop == null.
<A extends Annotation>
boolean
processAnnotation(A annotation, Class<?> owner, AppendValidation appender)
          Convenience method to process a single class-level annotation.
<A extends Annotation>
boolean
processAnnotation(A annotation, MetaProperty prop, Class<?> owner, AccessStrategy access, AppendValidation appender)
          Process a single annotation.
 boolean processAnnotations(MetaProperty prop, Class<?> owner, AnnotatedElement element, AccessStrategy access, AppendValidation appender)
          Process JSR303 annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationProcessor

public AnnotationProcessor(ApacheFactoryContext factoryContext)
Create a new AnnotationProcessor instance.

Parameters:
factoryContext -
Method Detail

processAnnotations

public boolean processAnnotations(MetaProperty prop,
                                  Class<?> owner,
                                  AnnotatedElement element,
                                  AccessStrategy access,
                                  AppendValidation appender)
                           throws IllegalAccessException,
                                  InvocationTargetException
Process JSR303 annotations.

Parameters:
prop - potentially null
owner - bean type
element - whose annotations to read
access - strategy for prop
appender - handling accumulation
Returns:
whether any processing took place
Throws:
IllegalAccessException
InvocationTargetException

processAnnotation

public final <A extends Annotation> boolean processAnnotation(A annotation,
                                                              Class<?> owner,
                                                              AppendValidation appender)
                                throws IllegalAccessException,
                                       InvocationTargetException
Convenience method to process a single class-level annotation.

Type Parameters:
A - annotation type
Parameters:
annotation - to process
owner - bean type
appender - handling accumulation
Returns:
whether any processing took place
Throws:
IllegalAccessException
InvocationTargetException

processAnnotation

public <A extends Annotation> boolean processAnnotation(A annotation,
                                                        MetaProperty prop,
                                                        Class<?> owner,
                                                        AccessStrategy access,
                                                        AppendValidation appender)
                          throws IllegalAccessException,
                                 InvocationTargetException
Process a single annotation.

Type Parameters:
A - annotation type
Parameters:
annotation - to process
prop - potentially null
owner - bean type
access - strategy for prop
appender - handling accumulation
Returns:
whether any processing took place
Throws:
IllegalAccessException
InvocationTargetException

addAccessStrategy

public boolean addAccessStrategy(MetaProperty prop,
                                 AccessStrategy access)
Add the specified AccessStrategy to prop; noop if prop == null.

Parameters:
prop -
access -
Returns:
whether anything took place.


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.