net.sf.tie.ext.annotation
Class AnnotationNotPresentRule
java.lang.Object
net.sf.tie.ext.annotation.AnnotationNotPresentRule
- All Implemented Interfaces:
- InterceptionRule
public class AnnotationNotPresentRule
- extends Object
- implements InterceptionRule
An InterceptionRule
that tests for the absence of a specific Annotation
.
Because this is a runtime test, the annotation must have runtime retention
.
The annotation must not be on the interface, the implementation, or on methods of either of these.
If an annotation is found, the rule will derive the correct interception strategy according to the placement of the annotation.
- See Also:
shouldIntercept(Class, Object, MethodInterceptor)
,
shouldIntercept(WrappedMethodInvocation, MethodInterceptor)
,
AnnotationNotPresentRule
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationNotPresentRule
public AnnotationNotPresentRule(Class<? extends Annotation> annotation)
shouldIntercept
public <T> ObjectInterceptionStrategy shouldIntercept(Class<T> interfc,
T target,
MethodInterceptor interceptor)
- Inspects
interfc
and target
and determines the correct ObjectInterceptionStrategy
to use
based on the presence (or otherwise) of the specific annotation
.
Let impl
be the Class
of target
. The following rules are applied in order.
- Specified by:
shouldIntercept
in interface InterceptionRule
shouldIntercept
public <T> MethodInterceptionStrategy shouldIntercept(WrappedMethodInvocation invocation,
MethodInterceptor interceptor)
- Specified by:
shouldIntercept
in interface InterceptionRule