Restlet Framework 2.2.1
Google App Engine

org.restlet.engine.resource
Class AnnotationUtils

java.lang.Object
  extended by org.restlet.engine.resource.AnnotationUtils

public class AnnotationUtils
extends Object

Utilities to manipulate Restlet annotations.

Author:
Jerome Louvel

Constructor Summary
protected AnnotationUtils()
          Protected constructor.
 
Method Summary
 void clearCache()
          Clears the annotation descriptors cache.
 AnnotationInfo getAnnotation(List<AnnotationInfo> annotations, Method javaMethod)
          Returns the first annotation descriptor matching the given Java method.
 AnnotationInfo getAnnotation(List<AnnotationInfo> annotations, Method restletMethod, Form query, Representation entity, MetadataService metadataService, ConverterService converterService)
          Returns the first annotation descriptor matching the given Restlet method.
 List<AnnotationInfo> getAnnotations(Class<?> clazz)
          Returns the annotation descriptors for the given resource class.
 List<AnnotationInfo> getAnnotations(Class<?> clazz, Method javaMethod)
          Returns the annotation descriptors for the given resource class.
static AnnotationUtils getInstance()
          Returns the current instance of AnnotationUtils.
protected  Method getRestletMethod(Annotation annotation, Annotation methodAnnotation)
          Returns an instance of Method according to the given annotations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationUtils

protected AnnotationUtils()
Protected constructor.

Method Detail

getInstance

public static AnnotationUtils getInstance()
Returns the current instance of AnnotationUtils.


clearCache

public void clearCache()
Clears the annotation descriptors cache.


getAnnotation

public AnnotationInfo getAnnotation(List<AnnotationInfo> annotations,
                                    Method javaMethod)
Returns the first annotation descriptor matching the given Java method.

Parameters:
annotations - The list of annotations.
javaMethod - The method to match.
Returns:
The annotation descriptor.

getAnnotation

public AnnotationInfo getAnnotation(List<AnnotationInfo> annotations,
                                    Method restletMethod,
                                    Form query,
                                    Representation entity,
                                    MetadataService metadataService,
                                    ConverterService converterService)
                             throws IOException
Returns the first annotation descriptor matching the given Restlet method.

Parameters:
annotations - The list of annotations.
restletMethod - The method to match.
query - The query parameters.
entity - The request entity to match or null if no entity is provided.
metadataService - The metadata service to use.
converterService - The converter service to use.
Returns:
The annotation descriptor.
Throws:
IOException

getAnnotations

public List<AnnotationInfo> getAnnotations(Class<?> clazz)
Returns the annotation descriptors for the given resource class.

Parameters:
clazz - The resource class to introspect.
Returns:
The list of annotation descriptors.

getAnnotations

public List<AnnotationInfo> getAnnotations(Class<?> clazz,
                                           Method javaMethod)
Returns the annotation descriptors for the given resource class.

Parameters:
javaMethod - The Java method.
Returns:
The list of annotation descriptors.

getRestletMethod

protected Method getRestletMethod(Annotation annotation,
                                  Annotation methodAnnotation)
Returns an instance of Method according to the given annotations.

Parameters:
annotation - Java annotation.
methodAnnotation - Annotation that corresponds to a Restlet method.
Returns:
An instance of Method according to the given annotations.

Restlet Framework 2.2.1
Google App Engine

Copyright © 2005-2014 Restlet.