Package org.glassfish.jersey.model
Class AnnotatedMethod
- java.lang.Object
-
- org.glassfish.jersey.model.AnnotatedMethod
-
- All Implemented Interfaces:
AnnotatedElement
- Direct Known Subclasses:
AnnotatedMethod
public class AnnotatedMethod extends Object implements AnnotatedElement
Annotated method representation.- Author:
- Paul Sandoz
-
-
Constructor Summary
Constructors Constructor Description AnnotatedMethod(Method method)Create annotated method instance from theJava method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Annotation>
TgetAnnotation(Class<T> annotationType)Annotation[]getAnnotations()Annotation[]getDeclaredAnnotations()MethodgetDeclaredMethod()Get the underlying declared Java method.Type[]getGenericParameterTypes()Get generic method parameter types.<T extends Annotation>
List<T>getMetaMethodAnnotations(Class<T> annotation)Get all instances of the specified meta-annotation type found on the method annotations.MethodgetMethod()Get the underlying Java method.Annotation[][]getParameterAnnotations()Get method parameter annotations.Class<?>[]getParameterTypes()Get method parameter types.TypeVariable<Method>[]getTypeParameters()Get method type parameters.booleanisAnnotationPresent(Class<? extends Annotation> annotationType)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
-
-
-
-
Constructor Detail
-
AnnotatedMethod
public AnnotatedMethod(Method method)
Create annotated method instance from theJava method.- Parameters:
method- Java method.
-
-
Method Detail
-
getMethod
public Method getMethod()
Get the underlying Java method.- Returns:
- the underlying Java method.
-
getDeclaredMethod
public Method getDeclaredMethod()
Get the underlying declared Java method. This method overrides or is the same as the one retrieved bygetMethod.- Returns:
- the underlying declared Java method.
-
getParameterAnnotations
public Annotation[][] getParameterAnnotations()
Get method parameter annotations.- Returns:
- method parameter annotations.
-
getParameterTypes
public Class<?>[] getParameterTypes()
Get method parameter types. See alsoMethod.getParameterTypes().- Returns:
- method parameter types.
-
getTypeParameters
public TypeVariable<Method>[] getTypeParameters()
Get method type parameters. See alsoMethod.getTypeParameters().- Returns:
- method type parameters.
-
getGenericParameterTypes
public Type[] getGenericParameterTypes()
Get generic method parameter types. See alsoMethod.getGenericParameterTypes().- Returns:
- generic method parameter types.
-
getMetaMethodAnnotations
public <T extends Annotation> List<T> getMetaMethodAnnotations(Class<T> annotation)
Get all instances of the specified meta-annotation type found on the method annotations.- Type Parameters:
T- meta-annotation type.- Parameters:
annotation- meta-annotation class to be searched for.- Returns:
- meta-annotation instances of a given type annotating the method annotations.
-
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement
-
getAnnotation
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- Specified by:
getAnnotationin interfaceAnnotatedElement
-
getAnnotations
public Annotation[] getAnnotations()
- Specified by:
getAnnotationsin interfaceAnnotatedElement
-
getDeclaredAnnotations
public Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement
-
-