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

Method Summary
static void clearCache()
          Clears the annotation descriptors cache.
static AnnotationInfo getAnnotation(List<AnnotationInfo> annotations, Method javaMethod)
          Returns the first annotation descriptor matching the given Java method.
static 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.
static List<AnnotationInfo> getAnnotations(Class<?> clazz)
          Returns the annotation descriptors for the given resource class.
static List<AnnotationInfo> getAnnotations(Class<?> clazz, Method javaMethod)
          Returns the annotation descriptors for the given resource class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearCache

public static void clearCache()
Clears the annotation descriptors cache.


getAnnotation

public static 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 static 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.

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.

getAnnotations

public static 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 static 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.


Copyright © 2005-2013 Restlet.