net.sf.tie.ext
Class InterceptionBuilder
java.lang.Object
net.sf.tie.ext.InterceptionBuilder
public class InterceptionBuilder
- extends Object
A builder class for generating interceptor stacks.
By default the builder will generate stack which does not do any caching of rules, but this can be enabled by calling setCachingEnabled(boolean)
Method Summary |
void |
addFactory(InterceptorFactory factory)
|
void |
always(MethodInterceptor interceptor)
|
MethodInterceptorStack |
done()
|
boolean |
isCachingEnabled()
|
void |
setCachingEnabled(boolean cachingEnabled)
|
void |
whenBoth(InterceptionRule left,
InterceptionRule right,
MethodInterceptor interceptor)
|
void |
whenEither(InterceptionRule left,
InterceptionRule right,
MethodInterceptor interceptor)
|
void |
whenInstanceOf(Class<?> type,
MethodInterceptor interceptor)
|
void |
whenNotInstanceOf(Class<?> type,
MethodInterceptor interceptor)
|
void |
whenNotPresent(Class<? extends Annotation> annotation,
MethodInterceptor interceptor)
|
void |
whenPresent(Class<? extends Annotation> annotation,
MethodInterceptor interceptor)
|
void |
whenRuleDoesntMatch(InterceptionRule rule,
MethodInterceptor interceptor)
|
void |
whenRuleMatches(InterceptionRule rule,
MethodInterceptor interceptor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InterceptionBuilder
public InterceptionBuilder()
setCachingEnabled
public void setCachingEnabled(boolean cachingEnabled)
isCachingEnabled
public boolean isCachingEnabled()
addFactory
public void addFactory(InterceptorFactory factory)
whenRuleMatches
public void whenRuleMatches(InterceptionRule rule,
MethodInterceptor interceptor)
always
public void always(MethodInterceptor interceptor)
whenRuleDoesntMatch
public void whenRuleDoesntMatch(InterceptionRule rule,
MethodInterceptor interceptor)
- See Also:
NotRule
whenEither
public void whenEither(InterceptionRule left,
InterceptionRule right,
MethodInterceptor interceptor)
- See Also:
OrRule
whenBoth
public void whenBoth(InterceptionRule left,
InterceptionRule right,
MethodInterceptor interceptor)
- See Also:
AndRule
whenPresent
public void whenPresent(Class<? extends Annotation> annotation,
MethodInterceptor interceptor)
- See Also:
AnnotationPresentRule
whenNotPresent
public void whenNotPresent(Class<? extends Annotation> annotation,
MethodInterceptor interceptor)
- See Also:
AnnotationNotPresentRule
whenInstanceOf
public void whenInstanceOf(Class<?> type,
MethodInterceptor interceptor)
- See Also:
InstanceOfRule
whenNotInstanceOf
public void whenNotInstanceOf(Class<?> type,
MethodInterceptor interceptor)
- See Also:
NotInstanceOfRule
done
public MethodInterceptorStack done()