Class MethodArgument
- java.lang.Object
-
- org.apache.commons.digester.annotations.reflect.MethodArgument
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
public final class MethodArgument extends java.lang.Object implements java.lang.reflect.AnnotatedElement
Class to supply the missing JavaAnnotatedElement
for method arguments.- Since:
- 2.1
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.annotation.Annotation[]
annotations
The method argument annotations.private int
index
The method argument index.private java.lang.Class<?>
parameterType
The method argument type.
-
Constructor Summary
Constructors Constructor Description MethodArgument(int index, java.lang.Class<?> parameterType, java.lang.annotation.Annotation[] annotations)
Creates a new method argument asAnnotatedElement
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationType)
java.lang.annotation.Annotation[]
getAnnotations()
private java.lang.annotation.Annotation[]
getAnnotationsArrayCopy()
Returns an annotations array, copy of the declared annotations in this method argument.java.lang.annotation.Annotation[]
getDeclaredAnnotations()
int
getIndex()
Returns the method argument index.java.lang.Class<?>
getParameterType()
Returns the method argument type.boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
-
-
-
Constructor Detail
-
MethodArgument
public MethodArgument(int index, java.lang.Class<?> parameterType, java.lang.annotation.Annotation[] annotations)
Creates a new method argument asAnnotatedElement
.- Parameters:
index
- the method argument index.parameterType
- the method argument type.annotations
- the method argument annotations.
-
-
Method Detail
-
getIndex
public int getIndex()
Returns the method argument index.- Returns:
- the method argument index.
-
getParameterType
public java.lang.Class<?> getParameterType()
Returns the method argument type.- Returns:
- the method argument type.
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
- Specified by:
getAnnotation
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotations
public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
getDeclaredAnnotations
public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
-
getAnnotationsArrayCopy
private java.lang.annotation.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(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
- Specified by:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
-
-