Class AnnotationUtils
- java.lang.Object
-
- org.apache.commons.digester3.annotations.utils.AnnotationUtils
-
public class AnnotationUtils extends java.lang.Object
Simple utility class to introspect annotations.- Since:
- 2.1
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
FIRE_ON_BEGIN
ThenamespaceURI
string constant.private static java.lang.String
NAMESPACE_URI
ThenamespaceURI
string constant.private static java.lang.String
PATTERN
Thepattern
string constant.private static java.lang.String
VALUE
Thevalue
string constant.
-
Constructor Summary
Constructors Modifier Constructor Description private
AnnotationUtils()
This class can't be instantiated.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getAnnotationNamespaceURI(java.lang.annotation.Annotation annotation)
Extract thenamespaceURI()
from annotation.static java.lang.String
getAnnotationPattern(java.lang.annotation.Annotation annotation)
Extract thepattern()
from annotation.static java.lang.annotation.Annotation[]
getAnnotationsArrayValue(java.lang.annotation.Annotation annotation)
Extract the Annotations arrayvalue()
from annotation if present, nul otherwise.static java.lang.Object
getAnnotationValue(java.lang.annotation.Annotation annotation)
Extract thevalue()
from annotation.static boolean
getFireOnBegin(java.lang.annotation.Annotation annotation)
Extract thefireOnBegin()
from annotation.private static java.lang.Object
invokeAnnotationMethod(java.lang.annotation.Annotation annotation, java.lang.String method)
Invokes an annotation method.
-
-
-
Field Detail
-
VALUE
private static final java.lang.String VALUE
Thevalue
string constant.- See Also:
- Constant Field Values
-
PATTERN
private static final java.lang.String PATTERN
Thepattern
string constant.- See Also:
- Constant Field Values
-
NAMESPACE_URI
private static final java.lang.String NAMESPACE_URI
ThenamespaceURI
string constant.- See Also:
- Constant Field Values
-
FIRE_ON_BEGIN
private static final java.lang.String FIRE_ON_BEGIN
ThenamespaceURI
string constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAnnotationValue
public static java.lang.Object getAnnotationValue(java.lang.annotation.Annotation annotation)
Extract thevalue()
from annotation.- Parameters:
annotation
- the annotation has to be introspected.- Returns:
- the annotation
value()
.
-
getAnnotationPattern
public static java.lang.String getAnnotationPattern(java.lang.annotation.Annotation annotation)
Extract thepattern()
from annotation.- Parameters:
annotation
- the annotation has to be introspected.- Returns:
- the annotation
pattern()
.
-
getAnnotationNamespaceURI
public static java.lang.String getAnnotationNamespaceURI(java.lang.annotation.Annotation annotation)
Extract thenamespaceURI()
from annotation.- Parameters:
annotation
- The annotation has to be introspected- Returns:
- The annotation
namespaceURI()
-
getFireOnBegin
public static boolean getFireOnBegin(java.lang.annotation.Annotation annotation)
Extract thefireOnBegin()
from annotation.- Parameters:
annotation
- The annotation has to be introspected- Returns:
- The annotation
fireOnBegin()
-
getAnnotationsArrayValue
public static java.lang.annotation.Annotation[] getAnnotationsArrayValue(java.lang.annotation.Annotation annotation)
Extract the Annotations arrayvalue()
from annotation if present, nul otherwise.- Parameters:
annotation
- the annotation has to be introspected.- Returns:
- the annotation
value()
as Annotations array.
-
invokeAnnotationMethod
private static java.lang.Object invokeAnnotationMethod(java.lang.annotation.Annotation annotation, java.lang.String method)
Invokes an annotation method.- Parameters:
annotationn
- the annotation has to be introspected.method
- the method name to execute.- Returns:
- the annotation method value, null if any error occurs.
-
-