Class AnnotationUtils


  • public class AnnotationUtils
    extends java.lang.Object
    Utilities to manipulate Restlet annotations.
    Author:
    Jerome Louvel
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearCache()
      Clears the annotation descriptors cache.
      static AnnotationInfo getAnnotation​(java.lang.reflect.Method javaMethod)
      Returns the annotation descriptor for the given resource class.
      static AnnotationInfo getAnnotation​(java.util.List<AnnotationInfo> annotations, java.lang.reflect.Method javaMethod)
      Returns the first annotation descriptor matching the given Java method.
      static AnnotationInfo getAnnotation​(java.util.List<AnnotationInfo> annotations, Method restletMethod)
      Returns the first annotation descriptor matching the given Restlet method.
      static java.util.List<AnnotationInfo> getAnnotations​(java.lang.Class<?> clazz)
      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​(java.lang.reflect.Method javaMethod)
        Returns the annotation descriptor for the given resource class.
        Parameters:
        javaMethod - The Java method.
        Returns:
        The annotation descriptor.
      • getAnnotation

        public static AnnotationInfo getAnnotation​(java.util.List<AnnotationInfo> annotations,
                                                   java.lang.reflect.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​(java.util.List<AnnotationInfo> annotations,
                                                   Method restletMethod)
        Returns the first annotation descriptor matching the given Restlet method.
        Parameters:
        annotations - The list of annotations.
        restletMethod - The method to match.
        Returns:
        The annotation descriptor.
      • getAnnotations

        public static java.util.List<AnnotationInfo> getAnnotations​(java.lang.Class<?> clazz)
        Returns the annotation descriptors for the given resource class.
        Parameters:
        clazz - The resource class to introspect.
        Returns:
        The list of annotation descriptors.