org.restlet.engine.resource

## Class AnnotationInfo

- java.lang.Object
- - org.restlet.engine.resource.AnnotationInfo

    public class AnnotationInfo
    extends java.lang.Object

Descriptor for method annotations.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`AnnotationInfo(java.lang.Class<?> resourceClass, Method restletMethod, java.lang.reflect.Method javaMethod, java.lang.String value)` Constructor.

### Method Summary

Methods
`boolean` `equals(java.lang.Object other)` Indicates if the current variant is equal to the given variant.
`java.lang.String` `getInputValue()` Returns the input part of the annotation value.
`java.lang.Class<?>` `getJavaInputType(int index)` Returns the generic type for the given input parameter.
`java.lang.Class<?>[]` `getJavaInputTypes()` Returns the input types of the Java method.
`java.lang.reflect.Method` `getJavaMethod()` Returns the annotated Java method.
`java.lang.Class<?>` `getJavaOutputType()` Returns the output type of the Java method.
`java.lang.String` `getOutputValue()` Returns the output part of the annotation value.
`java.util.List<Variant>` `getRequestVariants(MetadataService metadataService, ConverterService converterService)` Returns a list of request variants based on the annotation value.
`java.lang.Class<?>` `getResourceClass()` Returns the resource interface value.
`java.util.List<Variant>` `getResponseVariants(MetadataService metadataService, ConverterService converterService)` Returns a list of response variants based on the annotation value.
`Method` `getRestletMethod()` Returns the matching Restlet method.
`java.lang.String` `getValue()` Returns the annotation value.
`boolean` `isCompatible(Method restletMethod, Representation requestEntity, MetadataService metadataService, ConverterService converterService)` Indicates if the annotated method described is compatible with the given parameters.
`boolean` `isCompatibleRequestEntity(Representation requestEntity, MetadataService metadataService, ConverterService converterService)` Indicates if the given request entity is compatible with the annotated method described.
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### AnnotationInfo

    public AnnotationInfo(java.lang.Class<?> resourceClass,
                  Method restletMethod,
                  java.lang.reflect.Method javaMethod,
                  java.lang.String value)

Constructor.

Parameters:
  `resourceClass` - The class or interface that hosts the annotated Java method.
  `restletMethod` - The matching Restlet method.
  `javaMethod` - The annotated Java method.
  `value` - The annotation value.

### Method Detail

#### equals

    public boolean equals(java.lang.Object other)

Indicates if the current variant is equal to the given variant.

Overrides:
  `equals` in class `java.lang.Object`
Parameters:
  `other` - The other variant.
Returns:
  True if the current variant includes the other.

#### getInputValue

    public java.lang.String getInputValue()

Returns the input part of the annotation value.

Returns:
  The input part of the annotation value.

#### getJavaInputType

    public java.lang.Class<?> getJavaInputType(int index)

Returns the generic type for the given input parameter.

Parameters:
  `index` - The input parameter index.
Returns:
  The generic type.

#### getJavaInputTypes

    public java.lang.Class<?>[] getJavaInputTypes()

Returns the input types of the Java method.

Returns:
  The input types of the Java method.

#### getJavaMethod

    public java.lang.reflect.Method getJavaMethod()

Returns the annotated Java method.

Returns:
  The annotated Java method.

#### getJavaOutputType

    public java.lang.Class<?> getJavaOutputType()

Returns the output type of the Java method.

Returns:
  The output type of the Java method.

#### getOutputValue

    public java.lang.String getOutputValue()

Returns the output part of the annotation value.

Returns:
  The output part of the annotation value.

#### getRequestVariants

    public java.util.List<Variant> getRequestVariants(MetadataService metadataService,
                                             ConverterService converterService)

Returns a list of request variants based on the annotation value.

Parameters:
  `metadataService` - The metadata service to use.
Returns:
  A list of request variants.

#### getResourceClass

    public java.lang.Class<?> getResourceClass()

Returns the resource interface value.

Returns:
  The resource interface value.

#### getResponseVariants

    public java.util.List<Variant> getResponseVariants(MetadataService metadataService,
                                              ConverterService converterService)

Returns a list of response variants based on the annotation value.

Parameters:
  `metadataService` - The metadata service to use.
  `converterService` - The converter service to use.
Returns:
  A list of response variants.

#### getRestletMethod

    public Method getRestletMethod()

Returns the matching Restlet method.

Returns:
  The matching Restlet method.

#### getValue

    public java.lang.String getValue()

Returns the annotation value.

Returns:
  The annotation value.

#### isCompatible

    public boolean isCompatible(Method restletMethod,
                       Representation requestEntity,
                       MetadataService metadataService,
                       ConverterService converterService)

Indicates if the annotated method described is compatible with the given parameters.

Parameters:
  `restletMethod` - The Restlet method to match.
  `requestEntity` - Optional request entity.
  `metadataService` - The metadata service to use.
  `converterService` - The converter service to use.
Returns:
  True if the annotated method is compatible.

#### isCompatibleRequestEntity

    public boolean isCompatibleRequestEntity(Representation requestEntity,
                                    MetadataService metadataService,
                                    ConverterService converterService)

Indicates if the given request entity is compatible with the annotated method described.

Parameters:
  `requestEntity` - Optional request entity.
  `metadataService` - The metadata service to use.
  `converterService` - The converter service to use.
Returns:
  True if the given request entity is compatible with the annotated method described.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`