org.apache.struts2.convention.annotation
Class AnnotationTools

java.lang.Object
  extended by org.apache.struts2.convention.annotation.AnnotationTools

public class AnnotationTools
extends Object

This class provides helper methods for dealing with annotations.


Constructor Summary
AnnotationTools()
           
 
Method Summary
static
<T extends Annotation>
T
findAnnotation(Class<?> klass, Class<T> annotationClass)
          Returns the annotation on the given class or the package of the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationTools

public AnnotationTools()
Method Detail

findAnnotation

public static <T extends Annotation> T findAnnotation(Class<?> klass,
                                                      Class<T> annotationClass)
Returns the annotation on the given class or the package of the class. This searchs up the class hierarchy and the package hierarchy for the closest match.

Parameters:
klass - The class to search for the annotation.
annotationClass - The Class of the annotation.
Returns:
The annotation or null.


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