Package org.apache.shiro.aop
Class AnnotationHandler
- java.lang.Object
-
- org.apache.shiro.aop.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 Summary
Fields Modifier and Type Field Description protected Class<? extends Annotation>
annotationClass
The type of annotation this handler will process.
-
Constructor Summary
Constructors Constructor Description AnnotationHandler(Class<? extends Annotation> annotationClass)
Constructs anAnnotationHandler
who processes annotations of the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Annotation>
getAnnotationClass()
Returns the type of annotation this handler inspects and processes.protected Subject
getSubject()
Returns theSubject
associated with the currently-executing code.protected void
setAnnotationClass(Class<? extends Annotation> annotationClass)
Sets the type of annotation this handler will inspect and process.
-
-
-
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 anAnnotationHandler
who processes annotations of the specified type. Immediately callssetAnnotationClass(Class)
.- Parameters:
annotationClass
- the type of annotation this handler will process.
-
-
Method Detail
-
getSubject
protected Subject getSubject()
Returns theSubject
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 isnull
.
-
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.
-
-