org.apache.shiro.aop
Class AnnotationHandler

java.lang.Object
  extended by 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
protected  Class<? extends Annotation> annotationClass
          The type of annotation this handler will process.
 
Constructor Summary
AnnotationHandler(Class<? extends Annotation> annotationClass)
          Constructs an AnnotationHandler who processes annotations of the specified type.
 
Method Summary
 Class<? extends Annotation> getAnnotationClass()
          Returns the type of annotation this handler inspects and processes.
protected  Subject getSubject()
          Returns the Subject associated with the currently-executing code.
protected  void setAnnotationClass(Class<? extends Annotation> annotationClass)
          Sets the type of annotation this handler will inspect and process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.