public final class AnnotatedMethod
extends java.lang.Object
implements java.lang.reflect.AnnotatedElement
Modifier and Type | Field and Description |
---|---|
private java.lang.reflect.Method |
am |
private java.lang.reflect.Method |
m |
private static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
METHOD_ANNOTATIONS |
private static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
METHOD_META_ANNOTATIONS |
private java.lang.annotation.Annotation[] |
methodAnnotations |
private static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
PARAMETER_ANNOTATIONS |
private java.lang.annotation.Annotation[][] |
parameterAnnotations |
Constructor and Description |
---|
AnnotatedMethod(java.lang.reflect.Method method)
Create annotated method instance from the
Java method . |
Modifier and Type | Method and Description |
---|---|
private static boolean |
annotationNotInList(java.lang.Class<? extends java.lang.annotation.Annotation> ca,
java.util.List<java.lang.annotation.Annotation> la) |
private static <T> java.util.List<T> |
asList(T... ts) |
private static java.lang.reflect.Method |
findAnnotatedMethod(java.lang.Class<?> c,
java.lang.reflect.Method m) |
private static java.lang.reflect.Method |
findAnnotatedMethod(java.lang.reflect.Method m) |
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationType) |
java.lang.annotation.Annotation[] |
getAnnotations() |
java.lang.annotation.Annotation[] |
getDeclaredAnnotations() |
(package private) java.lang.reflect.Method |
getDeclaredMethod()
Get the underlying declared Java method.
|
java.lang.reflect.Type[] |
getGenericParameterTypes()
Get generic method parameter types.
|
<T extends java.lang.annotation.Annotation> |
getMetaMethodAnnotations(java.lang.Class<T> annotation)
Get all instances of the specified meta-annotation type found on the method
annotations.
|
java.lang.reflect.Method |
getMethod()
Get the underlying Java method.
|
java.lang.annotation.Annotation[][] |
getParameterAnnotations()
Get method parameter annotations.
|
java.lang.Class<?>[] |
getParameterTypes()
Get method parameter types.
|
private static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getSet(java.lang.Class<? extends java.lang.annotation.Annotation>... cs) |
java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] |
getTypeParameters()
Get method type parameters.
|
private static boolean |
hasAnnotations(java.lang.reflect.Method m) |
private static boolean |
hasMetaMethodAnnotations(java.lang.reflect.Method m) |
private static boolean |
hasMethodAnnotations(java.lang.reflect.Method m) |
private static boolean |
hasParameterAnnotations(java.lang.reflect.Method m) |
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType) |
private static java.lang.annotation.Annotation[] |
mergeMethodAnnotations(java.lang.reflect.Method m,
java.lang.reflect.Method am) |
private static java.lang.annotation.Annotation[][] |
mergeParameterAnnotations(java.lang.reflect.Method m,
java.lang.reflect.Method am) |
java.lang.String |
toString() |
private static final java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> METHOD_META_ANNOTATIONS
private static final java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> METHOD_ANNOTATIONS
private static final java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> PARAMETER_ANNOTATIONS
private final java.lang.reflect.Method m
private final java.lang.reflect.Method am
private final java.lang.annotation.Annotation[] methodAnnotations
private final java.lang.annotation.Annotation[][] parameterAnnotations
public AnnotatedMethod(java.lang.reflect.Method method)
Java method
.method
- Java method.@SafeVarargs private static java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getSet(java.lang.Class<? extends java.lang.annotation.Annotation>... cs)
public java.lang.reflect.Method getMethod()
java.lang.reflect.Method getDeclaredMethod()
getMethod
.public java.lang.annotation.Annotation[][] getParameterAnnotations()
public java.lang.Class<?>[] getParameterTypes()
Method.getParameterTypes()
.public java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters()
Method.getTypeParameters()
.public java.lang.reflect.Type[] getGenericParameterTypes()
Method.getGenericParameterTypes()
.public <T extends java.lang.annotation.Annotation> java.util.List<T> getMetaMethodAnnotations(java.lang.Class<T> annotation)
T
- meta-annotation type.annotation
- meta-annotation class to be searched for.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
isAnnotationPresent
in interface java.lang.reflect.AnnotatedElement
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
getAnnotation
in interface java.lang.reflect.AnnotatedElement
public java.lang.annotation.Annotation[] getAnnotations()
getAnnotations
in interface java.lang.reflect.AnnotatedElement
public java.lang.annotation.Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface java.lang.reflect.AnnotatedElement
private static java.lang.annotation.Annotation[] mergeMethodAnnotations(java.lang.reflect.Method m, java.lang.reflect.Method am)
private static java.lang.annotation.Annotation[][] mergeParameterAnnotations(java.lang.reflect.Method m, java.lang.reflect.Method am)
private static boolean annotationNotInList(java.lang.Class<? extends java.lang.annotation.Annotation> ca, java.util.List<java.lang.annotation.Annotation> la)
private static java.lang.reflect.Method findAnnotatedMethod(java.lang.reflect.Method m)
private static java.lang.reflect.Method findAnnotatedMethod(java.lang.Class<?> c, java.lang.reflect.Method m)
private static boolean hasAnnotations(java.lang.reflect.Method m)
private static boolean hasMetaMethodAnnotations(java.lang.reflect.Method m)
private static boolean hasMethodAnnotations(java.lang.reflect.Method m)
private static boolean hasParameterAnnotations(java.lang.reflect.Method m)
@SafeVarargs private static <T> java.util.List<T> asList(T... ts)