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