org.glassfish.jersey.server.model
Class AnnotatedMethod

java.lang.Object
  extended by org.glassfish.jersey.server.model.AnnotatedMethod
All Implemented Interfaces:
java.lang.reflect.AnnotatedElement

public final class AnnotatedMethod
extends java.lang.Object
implements java.lang.reflect.AnnotatedElement

Annotated method representation.

Author:
Paul Sandoz

Constructor Summary
AnnotatedMethod(java.lang.reflect.Method method)
          Create annotated method instance from the Java method.
 
Method Summary
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType)
           
 java.lang.annotation.Annotation[] getAnnotations()
           
 java.lang.annotation.Annotation[] getDeclaredAnnotations()
           
 java.lang.reflect.Type[] getGenericParameterTypes()
          Get generic method parameter types.
<T extends java.lang.annotation.Annotation>
java.util.List<T>
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.
 java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters()
          Get method type parameters.
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotatedMethod

public AnnotatedMethod(java.lang.reflect.Method method)
Create annotated method instance from the Java method.

Parameters:
method - Java method.
Method Detail

getMethod

public java.lang.reflect.Method getMethod()
Get the underlying Java method.

Returns:
the underlying Java method.

getParameterAnnotations

public java.lang.annotation.Annotation[][] getParameterAnnotations()
Get method parameter annotations.

Returns:
method parameter annotations.

getParameterTypes

public java.lang.Class<?>[] getParameterTypes()
Get method parameter types. See also Method.getParameterTypes().

Returns:
method parameter types.

getTypeParameters

public java.lang.reflect.TypeVariable<java.lang.reflect.Method>[] getTypeParameters()
Get method type parameters. See also Method.getTypeParameters().

Returns:
method type parameters.

getGenericParameterTypes

public java.lang.reflect.Type[] getGenericParameterTypes()
Get generic method parameter types. See also Method.getGenericParameterTypes().

Returns:
generic method parameter types.

getMetaMethodAnnotations

public <T extends java.lang.annotation.Annotation> java.util.List<T> getMetaMethodAnnotations(java.lang.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.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Specified by:
isAnnotationPresent in interface java.lang.reflect.AnnotatedElement

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
Specified by:
getAnnotation in interface java.lang.reflect.AnnotatedElement

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()
Specified by:
getAnnotations in interface java.lang.reflect.AnnotatedElement

getDeclaredAnnotations

public java.lang.annotation.Annotation[] getDeclaredAnnotations()
Specified by:
getDeclaredAnnotations in interface java.lang.reflect.AnnotatedElement


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.