public class AnnotationUtils extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotationUtils()
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Clears the annotation descriptors cache.
|
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.
|
MethodAnnotationInfo |
getMethodAnnotation(List<AnnotationInfo> annotations,
Method javaMethod)
Returns the first annotation descriptor matching the given Java method.
|
MethodAnnotationInfo |
getMethodAnnotation(List<AnnotationInfo> annotations,
Method restletMethod,
Form query,
Representation entity,
MetadataService metadataService,
ConverterService converterService)
Returns the first annotation descriptor matching the given Restlet method.
|
protected Method |
getRestletMethod(Annotation annotation,
Annotation methodAnnotation)
Returns an instance of
Method according to the given annotations. |
ThrowableAnnotationInfo |
getThrowableAnnotationInfo(Class<?> clazz)
Returns the status annotation descriptor if present or null.
|
ThrowableAnnotationInfo |
getThrowableAnnotationInfo(Method javaMethod,
int errorCode)
Returns the
Throwable class matching the given error code if present
or null. |
Class<?> |
getThrowableClass(Method javaMethod,
int errorCode)
Returns the
Throwable class matching the given error code if present
or null. |
public static AnnotationUtils getInstance()
public void clearCache()
public List<AnnotationInfo> getAnnotations(Class<?> clazz)
clazz - The resource class to introspect.public List<AnnotationInfo> getAnnotations(Class<?> clazz, Method javaMethod)
javaMethod - The Java method.public MethodAnnotationInfo getMethodAnnotation(List<AnnotationInfo> annotations, Method javaMethod)
annotations - The list of annotations.javaMethod - The method to match.public MethodAnnotationInfo getMethodAnnotation(List<AnnotationInfo> annotations, Method restletMethod, Form query, Representation entity, MetadataService metadataService, ConverterService converterService) throws IOException
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.IOExceptionprotected Method getRestletMethod(Annotation annotation, Annotation methodAnnotation)
Method according to the given annotations.annotation - Java annotation.methodAnnotation - Annotation that corresponds to a Restlet method.Method according to the given annotations.public ThrowableAnnotationInfo getThrowableAnnotationInfo(Class<?> clazz)
clazz - The class with the status attached.public ThrowableAnnotationInfo getThrowableAnnotationInfo(Method javaMethod, int errorCode)
Throwable class matching the given error code if present
or null.Copyright © 2005–2025. All rights reserved.