net.sf.tie.ext.type
Class NotInstanceOfRule

java.lang.Object
  extended by net.sf.tie.ext.type.NotInstanceOfRule
All Implemented Interfaces:
InterceptionRule

public class NotInstanceOfRule
extends Object
implements InterceptionRule

InterceptionRule that tests whether the object to be intercepted is not an instance of a specified class or interface.


Constructor Summary
NotInstanceOfRule(Class<?> type)
           
 
Method Summary
<T> ObjectInterceptionStrategy
shouldIntercept(Class<T> interfc, T target, MethodInterceptor interceptor)
           
<T> MethodInterceptionStrategy
shouldIntercept(WrappedMethodInvocation invocation, MethodInterceptor interceptor)
          In theory, this method should never be called as shouldIntercept(Class, Object, MethodInterceptor) never returns ObjectInterceptionStrategy.INTERCEPT_SOME_METHODS_ON_OBJECT (or similar).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotInstanceOfRule

public NotInstanceOfRule(Class<?> type)
Method Detail

shouldIntercept

public <T> ObjectInterceptionStrategy shouldIntercept(Class<T> interfc,
                                                      T target,
                                                      MethodInterceptor interceptor)
Specified by:
shouldIntercept in interface InterceptionRule
Returns:

shouldIntercept

public <T> MethodInterceptionStrategy shouldIntercept(WrappedMethodInvocation invocation,
                                                      MethodInterceptor interceptor)
In theory, this method should never be called as shouldIntercept(Class, Object, MethodInterceptor) never returns ObjectInterceptionStrategy.INTERCEPT_SOME_METHODS_ON_OBJECT (or similar). However, the AndRule / OrRule does not try and keep track of which rule returned "INTERCEPT_SOME_METHODS_..." so it is possible that it will call shouldIntercept(WrappedMethodInvocation, MethodInterceptor) on a rule which had returned ObjectInterceptionStrategy.ALWAYS_INTERCEPT_INTERFACE or ObjectInterceptionStrategy.NEVER_INTERCEPT_IMPLEMENTATION_CLASS

Specified by:
shouldIntercept in interface InterceptionRule