Package org.apache.turbine.annotation
Class AnnotationProcessor
- java.lang.Object
-
- org.apache.turbine.annotation.AnnotationProcessor
-
public class AnnotationProcessor extends Object
AnnotationProcessor contains static helper methods that handle the Turbine annotations for objects- Version:
- $Id: TurbineAssemblerBrokerService.java 1521103 2013-09-09 13:38:07Z tv $
- Author:
- Thomas Vandahl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnnotationProcessor.ConditionType
-
Constructor Summary
Constructors Constructor Description AnnotationProcessor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Annotation[]
getAnnotations(AccessibleObject object)
Get cached annotations for field, class or methodstatic <A extends org.apache.fulcrum.security.model.turbine.TurbineAccessControlList<?>>
booleanisAuthorized(AccessibleObject object, A acl)
Check if the object given is authorized to be executed based on its annotations The method will return false if one of the annotations denies executionstatic <A extends org.apache.fulcrum.security.model.turbine.TurbineAccessControlList<?>>
booleanisAuthorized(AccessibleObject object, A acl, AnnotationProcessor.ConditionType conditonType)
Check if the object given is authorized to be executed based on its annotations The method's return value depends on the conditonType, refer to the ConditionTypestatic void
process(Object object)
Search for annotated fields of the object and inject the appropriate objects
-
-
-
Constructor Detail
-
AnnotationProcessor
public AnnotationProcessor()
-
-
Method Detail
-
getAnnotations
public static Annotation[] getAnnotations(AccessibleObject object)
Get cached annotations for field, class or method- Parameters:
object
- a field, class or method- Returns:
- the declared annotations for the object
-
isAuthorized
public static <A extends org.apache.fulcrum.security.model.turbine.TurbineAccessControlList<?>> boolean isAuthorized(AccessibleObject object, A acl)
Check if the object given is authorized to be executed based on its annotations The method will return false if one of the annotations denies execution- Type Parameters:
A
- ACL instance- Parameters:
object
- accessible object to testacl
- access control list- Returns:
- true if the execution is allowed
- See Also:
isAuthorized(AccessibleObject, TurbineAccessControlList, ConditionType)
-
isAuthorized
public static <A extends org.apache.fulcrum.security.model.turbine.TurbineAccessControlList<?>> boolean isAuthorized(AccessibleObject object, A acl, AnnotationProcessor.ConditionType conditonType)
Check if the object given is authorized to be executed based on its annotations The method's return value depends on the conditonType, refer to the ConditionType- Type Parameters:
A
- ACL instance- Parameters:
object
- the objectacl
- access control listconditonType
- eitherAnnotationProcessor.ConditionType.COMPOUND
: The method will return false if one of the annotations denies execution orAnnotationProcessor.ConditionType.ANY
: The method will return true if one of the annotations allows execution- Returns:
- true if the execution is allowed
-
process
public static void process(Object object) throws TurbineException
Search for annotated fields of the object and inject the appropriate objects- Parameters:
object
- the object- Throws:
TurbineException
- if the objects could not be injected
-
-