Class Classes
java.lang.Object
org.openxava.util.Classes
Utility class to work with classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetAnnotationAttributeValue(Annotation annotation, String attribute) static Annotation[]static FieldGet a field of the specified class or any of its subclasses, even if it is private.static Collection<Field> getFieldsAnnotatedWith(Class theClass, Class<? extends Annotation> annotation) All fields from all superclasess and including private, protected and public.static Collection<Method> getMethodsAnnotatedWith(Class theClass, Class<? extends Annotation> annotation) Returns the collection of methods with the given annotationstatic booleanIf the class contains the exact method without argumetns.
-
Constructor Details
-
Classes
public Classes()
-
-
Method Details
-
hasMethod
-
getFieldsAnnotatedWith
public static Collection<Field> getFieldsAnnotatedWith(Class theClass, Class<? extends Annotation> annotation) All fields from all superclasess and including private, protected and public.- Parameters:
theClass-- Returns:
-
getField
Get a field of the specified class or any of its subclasses, even if it is private.- Parameters:
theClass- Class where we want to get the field- Returns:
- fieldName Name of the field we want to get
- Throws:
NoSuchFieldException- If the field is not present in theClass and in any of its subclasses- Since:
- 7.0
-
getMethodsAnnotatedWith
public static Collection<Method> getMethodsAnnotatedWith(Class theClass, Class<? extends Annotation> annotation) Returns the collection of methods with the given annotation- Parameters:
theClass- Class object to be examinedannotation- Annotation type to be search for- Returns:
- a Collection of Method, never null, might be empty.
- Since:
- 4.0.1
-
getAnnotationAttributeValue
- Since:
- 7.4
-
getAnnotationsWithRepeatables
- Since:
- 7.4
-