net.sf.tie.ext.type
Class NotInstanceOfRule
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotInstanceOfRule
public NotInstanceOfRule(Class<?> type)
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