Class 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
      The namespaceURI string constant.
      private static java.lang.String NAMESPACE_URI
      The namespaceURI string constant.
      private static java.lang.String PATTERN
      The pattern string constant.
      private static java.lang.String VALUE
      The value 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 the namespaceURI() from annotation.
      static java.lang.String getAnnotationPattern​(java.lang.annotation.Annotation annotation)
      Extract the pattern() from annotation.
      static java.lang.annotation.Annotation[] getAnnotationsArrayValue​(java.lang.annotation.Annotation annotation)
      Extract the Annotations array value() from annotation if present, nul otherwise.
      static java.lang.Object getAnnotationValue​(java.lang.annotation.Annotation annotation)
      Extract the value() from annotation.
      static boolean getFireOnBegin​(java.lang.annotation.Annotation annotation)
      Extract the fireOnBegin() from annotation.
      private static java.lang.Object invokeAnnotationMethod​(java.lang.annotation.Annotation annotation, java.lang.String method)
      Invokes an annotation method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VALUE

        private static final java.lang.String VALUE
        The value string constant.
        See Also:
        Constant Field Values
      • PATTERN

        private static final java.lang.String PATTERN
        The pattern string constant.
        See Also:
        Constant Field Values
      • NAMESPACE_URI

        private static final java.lang.String NAMESPACE_URI
        The namespaceURI string constant.
        See Also:
        Constant Field Values
      • FIRE_ON_BEGIN

        private static final java.lang.String FIRE_ON_BEGIN
        The namespaceURI string constant.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AnnotationUtils

        private AnnotationUtils()
        This class can't be instantiated.
    • Method Detail

      • getAnnotationValue

        public static java.lang.Object getAnnotationValue​(java.lang.annotation.Annotation annotation)
        Extract the value() 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 the pattern() 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 the namespaceURI() 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 the fireOnBegin() 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 array value() 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.