|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork2.util.AnnotationUtils
public class AnnotationUtils
AnnotationUtils
Various utility methods dealing with annotations
Constructor Summary | |
---|---|
AnnotationUtils()
|
Method Summary | |
---|---|
static void |
addAllFields(java.lang.Class annotationClass,
java.lang.Class clazz,
java.util.List<java.lang.reflect.Field> allFields)
Adds all fields with the specified Annotation of class clazz and its superclasses to allFields |
static void |
addAllInterfaces(java.lang.Class clazz,
java.util.List<java.lang.Class> allInterfaces)
|
static void |
addAllMethods(java.lang.Class annotationClass,
java.lang.Class clazz,
java.util.List<java.lang.reflect.Method> allMethods)
Adds all methods with the specified Annotation of class clazz and its superclasses to allFields |
static java.lang.String[] |
find(java.lang.Class clazz,
java.lang.String pckgname)
Retrieves all classes within a packages. |
static java.util.List<java.lang.reflect.Method> |
findAnnotatedMethods(java.lang.Class clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Deprecated. since 2.0.4 use getAnnotatedMethods |
static void |
findRecursively(java.lang.Class clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
java.util.List<java.lang.reflect.Method> methods)
Deprecated. since 2.0.4 use getAnnotatedMethods |
static java.util.Collection<java.lang.reflect.Method> |
getAnnotatedMethods(java.lang.Class clazz,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotation)
For the given Class get a collection of the the AnnotatedElement s
that match the given annotation s or if no annotation s are
specified then return all of the annotated elements of the given Class . |
static boolean |
isAnnotatedBy(java.lang.reflect.AnnotatedElement annotatedElement,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotation)
Varargs version of AnnotatedElement.isAnnotationPresent() |
static java.lang.String |
resolvePropertyName(java.lang.reflect.Method method)
Returns the property name for a method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationUtils()
Method Detail |
---|
public static void addAllFields(java.lang.Class annotationClass, java.lang.Class clazz, java.util.List<java.lang.reflect.Field> allFields)
annotationClass
- clazz
- allFields
- public static void addAllMethods(java.lang.Class annotationClass, java.lang.Class clazz, java.util.List<java.lang.reflect.Method> allMethods)
annotationClass
- clazz
- allMethods
- public static void addAllInterfaces(java.lang.Class clazz, java.util.List<java.lang.Class> allInterfaces)
clazz
- allInterfaces
- public static final java.util.Collection<java.lang.reflect.Method> getAnnotatedMethods(java.lang.Class clazz, java.lang.Class<? extends java.lang.annotation.Annotation>... annotation)
Class
get a collection of the the AnnotatedElement
s
that match the given annotation
s or if no annotation
s are
specified then return all of the annotated elements of the given Class
.
Includes only the method level annotations.
clazz
- The Class
to inspectannotation
- the Annotation
s to find
Collection
<AnnotatedElement
> containing all of the
method AnnotatedElement
s matching the specified Annotation
spublic static final boolean isAnnotatedBy(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.Class<? extends java.lang.annotation.Annotation>... annotation)
AnnotatedElement.isAnnotationPresent()
AnnotatedElement
@Deprecated public static java.util.List<java.lang.reflect.Method> findAnnotatedMethods(java.lang.Class clazz, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
@Deprecated public static void findRecursively(java.lang.Class clazz, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.util.List<java.lang.reflect.Method> methods)
public static java.lang.String resolvePropertyName(java.lang.reflect.Method method)
method
- The method to get the property name for.
public static java.lang.String[] find(java.lang.Class clazz, java.lang.String pckgname)
pckgname
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |