net.sf.tie.ext.annotation
Class AnnotationNotPresentRule

java.lang.Object
  extended by 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

Constructor Summary
AnnotationNotPresentRule(Class<? extends Annotation> annotation)
           
 
Method Summary
<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.
<T> MethodInterceptionStrategy
shouldIntercept(WrappedMethodInvocation invocation, MethodInterceptor interceptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationNotPresentRule

public AnnotationNotPresentRule(Class<? extends Annotation> annotation)
Method Detail

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