T
- the decorated typepublic class FilteringMethodDecorator<T>
extends com.thoughtworks.proxy.toys.decorate.Decorator<T>
Decorator
which delegates to another only for methods accepted by the given Predicate
.
TODO: methodSelector is called 4 times, but I couldn't find a way to hook this into ProxyToys without rewriting more code.Constructor and Description |
---|
FilteringMethodDecorator(com.thoughtworks.proxy.toys.decorate.Decorator<T> delegate,
com.google.common.base.Predicate<Method> methodSelector) |
Modifier and Type | Method and Description |
---|---|
Object[] |
beforeMethodStarts(T proxy,
Method method,
Object[] args) |
Exception |
decorateInvocationException(T proxy,
Method method,
Object[] args,
Exception cause) |
Object |
decorateResult(T proxy,
Method method,
Object[] args,
Object result) |
Throwable |
decorateTargetException(T proxy,
Method method,
Object[] args,
Throwable cause) |
public Object[] beforeMethodStarts(T proxy, Method method, Object[] args)
beforeMethodStarts
in class com.thoughtworks.proxy.toys.decorate.Decorator<T>
public Object decorateResult(T proxy, Method method, Object[] args, Object result)
decorateResult
in class com.thoughtworks.proxy.toys.decorate.Decorator<T>
public Throwable decorateTargetException(T proxy, Method method, Object[] args, Throwable cause)
decorateTargetException
in class com.thoughtworks.proxy.toys.decorate.Decorator<T>
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.