org.glassfish.jersey.model

## Class AnnotatedMethod

- java.lang.Object
- - org.glassfish.jersey.model.AnnotatedMethod

All Implemented Interfaces:
  AnnotatedElement

    public class AnnotatedMethod
    extends Object
    implements AnnotatedElement

Annotated method representation.

Author:
  Paul Sandoz

### Constructor Summary

Constructors
Constructor and Description
`AnnotatedMethod(Method method)` Create annotated method instance from the `Java method`.

### Method Summary

All Methods Instance Methods Concrete Methods
`<T extends Annotation> T` `getAnnotation(Class<T> annotationType)`
`Annotation[]` `getAnnotations()`
`Annotation[]` `getDeclaredAnnotations()`
`Method` `getDeclaredMethod()` 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.
`Method` `getMethod()` Get the underlying Java method.
`Annotation[][]` `getParameterAnnotations()` Get method parameter annotations.
`Class<?>[]` `getParameterTypes()` Get method parameter types.
`TypeVariable<Method>[]` `getTypeParameters()` Get method type parameters.
`boolean` `isAnnotationPresent(Class<? extends Annotation> annotationType)`
`String` `toString()`

### 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 the `Java 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 by `getMethod`.

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 also `Method.getParameterTypes()`.

Returns:
  method parameter types.

#### getTypeParameters

    public TypeVariable<Method>[] getTypeParameters()

Get method type parameters. See also `Method.getTypeParameters()`.

Returns:
  method type parameters.

#### getGenericParameterTypes

    public Type[] getGenericParameterTypes()

Get generic method parameter types. See also `Method.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.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### isAnnotationPresent

    public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Specified by:
  `isAnnotationPresent` in interface `AnnotatedElement`

#### 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`