|
||||||||||
| 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
| Field Summary | |
|---|---|
private static Pattern |
GETTER_PATTERN
|
private static Pattern |
SETTER_PATTERN
|
| Constructor Summary | |
|---|---|
AnnotationUtils()
|
|
| Method Summary | |
|---|---|
static void |
addAllFields(Class annotationClass,
Class clazz,
List<Field> allFields)
Adds all fields with the specified Annotation of class clazz and its superclasses to allFields |
static void |
addAllInterfaces(Class clazz,
List allInterfaces)
|
static void |
addAllMethods(Class annotationClass,
Class clazz,
List<Method> allMethods)
Adds all methods with the specified Annotation of class clazz and its superclasses to allFields |
static String[] |
find(Class clazz,
String pckgname)
Retrieves all classes within a packages. |
static List<Method> |
findAnnotatedMethods(Class clazz,
Class<? extends Annotation> annotationClass)
Deprecated. since 2.0.4 use getAnnotatedMethods |
static void |
findRecursively(Class clazz,
Class<? extends Annotation> annotationClass,
List<Method> methods)
Deprecated. since 2.0.4 use getAnnotatedMethods |
static Collection<Method> |
getAnnotatedMethods(Class clazz,
Class<? extends Annotation>... annotation)
For the given Class get a collection of the the AnnotatedElements
that match the given annotations or if no annotations are
specified then return all of the annotated elements of the given Class. |
static boolean |
isAnnotatedBy(AnnotatedElement annotatedElement,
Class<? extends Annotation>... annotation)
Varargs version of AnnotatedElement.isAnnotationPresent() |
static String |
resolvePropertyName(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 |
| Field Detail |
|---|
private static final Pattern SETTER_PATTERN
private static final Pattern GETTER_PATTERN
| Constructor Detail |
|---|
public AnnotationUtils()
| Method Detail |
|---|
public static void addAllFields(Class annotationClass,
Class clazz,
List<Field> allFields)
annotationClass - clazz - allFields -
public static void addAllMethods(Class annotationClass,
Class clazz,
List<Method> allMethods)
annotationClass - clazz - allMethods -
public static void addAllInterfaces(Class clazz,
List allInterfaces)
clazz - allInterfaces -
public static final Collection<Method> getAnnotatedMethods(Class clazz,
Class<? extends Annotation>... annotation)
Class get a collection of the the AnnotatedElements
that match the given annotations or if no annotations 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 Annotations to find
Collection<AnnotatedElement> containing all of the
method AnnotatedElements matching the specified Annotations
public static final boolean isAnnotatedBy(AnnotatedElement annotatedElement,
Class<? extends Annotation>... annotation)
AnnotatedElement.isAnnotationPresent()
AnnotatedElement
@Deprecated
public static List<Method> findAnnotatedMethods(Class clazz,
Class<? extends Annotation> annotationClass)
@Deprecated
public static void findRecursively(Class clazz,
Class<? extends Annotation> annotationClass,
List<Method> methods)
public static String resolvePropertyName(Method method)
method - The method to get the property name for.
public static String[] find(Class clazz,
String pckgname)
pckgname -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||