Class AnnotationUtils

java.lang.Object
org.apache.commons.digester.annotations.utils.AnnotationUtils

public class AnnotationUtils extends Object
Simple utility class to introspect annotations.
Since:
2.1
  • Field Details

  • Constructor Details

    • AnnotationUtils

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

    • getAnnotationValue

      public static Object getAnnotationValue(Annotation annotation)
      Extract the value() from annotation.
      Parameters:
      annotation - the annotation has to be introspected.
      Returns:
      the annotation value().
    • getAnnotationPattern

      public static String getAnnotationPattern(Annotation annotation)
      Extract the pattern() from annotation.
      Parameters:
      annotation - the annotation has to be introspected.
      Returns:
      the annotation pattern().
    • getAnnotationsArrayValue

      public static Annotation[] getAnnotationsArrayValue(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 Object invokeAnnotationMethod(Annotation annotation, 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.