Class AnnotationHandler

  • Direct Known Subclasses:
    AuthorizingAnnotationHandler

    public abstract class AnnotationHandler
    extends Object
    Base support class for implementations that reads and processes JSR-175 annotations.
    Since:
    0.9.0
    • Field Detail

      • annotationClass

        protected Class<? extends Annotation> annotationClass
        The type of annotation this handler will process.
    • Constructor Detail

      • AnnotationHandler

        public AnnotationHandler​(Class<? extends Annotation> annotationClass)
        Constructs an AnnotationHandler who processes annotations of the specified type. Immediately calls setAnnotationClass(Class).
        Parameters:
        annotationClass - the type of annotation this handler will process.
    • Method Detail

      • getSubject

        protected Subject getSubject()
        Returns the Subject associated with the currently-executing code.

        This default implementation merely calls SecurityUtils.getSubject().

        Returns:
        the Subject associated with the currently-executing code.
      • setAnnotationClass

        protected void setAnnotationClass​(Class<? extends Annotation> annotationClass)
                                   throws IllegalArgumentException
        Sets the type of annotation this handler will inspect and process.
        Parameters:
        annotationClass - the type of annotation this handler will process.
        Throws:
        IllegalArgumentException - if the argument is null.
      • getAnnotationClass

        public Class<? extends Annotation> getAnnotationClass()
        Returns the type of annotation this handler inspects and processes.
        Returns:
        the type of annotation this handler inspects and processes.