org.apache.struts2.convention.annotation
Class AnnotationTools

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

public class AnnotationTools
extends java.lang.Object

This class provides helper methods for dealing with annotations.


Constructor Summary
AnnotationTools()
           
 
Method Summary
static
<T extends java.lang.annotation.Annotation>
T
findAnnotation(java.lang.Class<?> klass, java.lang.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 java.lang.annotation.Annotation> T findAnnotation(java.lang.Class<?> klass,
                                                                           java.lang.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-2011 Apache Software Foundation. All Rights Reserved.