Class AopHelper
java.lang.Object
org.tynamo.shiro.extension.authz.aop.AopHelper
Simple util class, help work with annotations and create interceptors
based on annotations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.shiro.authz.aop.AuthorizingAnnotationHandlercreateHandler(Annotation annotation) CreateAuthorizingAnnotationHandlerfor annotation.static List<SecurityInterceptor> createSecurityInterceptors(Method method, Class<?> clazz) Create list ofSecurityInterceptorinstances for method.static List<SecurityInterceptor> createSecurityInterceptorsSeeingInterfaces(Method method, Class<?> targetClass) Create list ofSecurityInterceptorinstances for method.static MethodfindTargetMethod(Method method, Class<?> targetClass) Find the target method of interface.static Collection<Class<? extends Annotation>> static booleanisInterceptOnClassAnnotation(int modifiers) Rule under which determined the fate of the class contains annotation.
-
Constructor Details
-
AopHelper
public AopHelper()
-
-
Method Details
-
createHandler
public static org.apache.shiro.authz.aop.AuthorizingAnnotationHandler createHandler(Annotation annotation) CreateAuthorizingAnnotationHandlerfor annotation.- Parameters:
annotation- the given annotation- Returns:
- Returns implementation for this AuthorizingAnnotationHandler
-
createSecurityInterceptors
Create list ofSecurityInterceptorinstances for method. This method search all method and class annotations and use annotation data for create interceptors. This method considers only those annotations that have been declared in the set through parameters of the method and class, regardless of the inheritance or interface implementations- Parameters:
method-clazz-- Returns:
-
createSecurityInterceptorsSeeingInterfaces
public static List<SecurityInterceptor> createSecurityInterceptorsSeeingInterfaces(Method method, Class<?> targetClass) Create list ofSecurityInterceptorinstances for method. This method search all method and class annotations and use annotation data for create interceptors. In contrast of thecreateSecurityInterceptors(Method, Class), this method looking for the annotations in all interfaces, witch implement the targetClass. The following rules- If annotation on class presents, will be intercepted all methods in the class, that satisfy the
.
invalid reference
rule - Annotations on methods are not inherited.
- Annotations on classes are not inherited.
- The annotations are searched in all interfaces, witch implement the targetClass.
- Parameters:
method-targetClass-- Returns:
- If annotation on class presents, will be intercepted all methods in the class, that satisfy the
-
findTargetMethod
Find the target method of interface. Ensure this: If a class have an interface, then method parameter from interface and targetClass implementation. -
isInterceptOnClassAnnotation
public static boolean isInterceptOnClassAnnotation(int modifiers) Rule under which determined the fate of the class contains annotation. All public and protected methods. -
getAutorizationAnnotationClasses
-