Class MethodArgument

java.lang.Object
org.apache.commons.digester.annotations.reflect.MethodArgument
All Implemented Interfaces:
AnnotatedElement

public final class MethodArgument extends Object implements AnnotatedElement
Class to supply the missing Java AnnotatedElement for method arguments.
Since:
2.1
  • Field Details

    • index

      private final int index
      The method argument index.
    • parameterType

      private final Class<?> parameterType
      The method argument type.
    • annotations

      private final Annotation[] annotations
      The method argument annotations.
  • Constructor Details

    • MethodArgument

      public MethodArgument(int index, Class<?> parameterType, Annotation[] annotations)
      Creates a new method argument as AnnotatedElement.
      Parameters:
      index - the method argument index.
      parameterType - the method argument type.
      annotations - the method argument annotations.
  • Method Details

    • getIndex

      public int getIndex()
      Returns the method argument index.
      Returns:
      the method argument index.
    • getParameterType

      public Class<?> getParameterType()
      Returns the method argument type.
      Returns:
      the method argument type.
    • getAnnotation

      public <T extends Annotation> T getAnnotation(Class<T> annotationType)
      Specified by:
      getAnnotation in interface AnnotatedElement
    • getAnnotations

      public Annotation[] getAnnotations()
      Specified by:
      getAnnotations in interface AnnotatedElement
    • getDeclaredAnnotations

      public Annotation[] getDeclaredAnnotations()
      Specified by:
      getDeclaredAnnotations in interface AnnotatedElement
    • getAnnotationsArrayCopy

      private Annotation[] getAnnotationsArrayCopy()
      Returns an annotations array, copy of the declared annotations in this method argument.
      Returns:
      an annotations array, copy of the declared annotations in this method argument.
    • isAnnotationPresent

      public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
      Specified by:
      isAnnotationPresent in interface AnnotatedElement