public abstract class DecoratorInvocationHandler<T> extends Object implements InvocationHandler
Constructor and Description |
---|
DecoratorInvocationHandler(T target,
T decorator) |
Modifier and Type | Method and Description |
---|---|
T |
getDecorator() |
protected abstract Object |
getResult(Object firstResult,
Object secondResult) |
T |
getTarget() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
protected abstract Object |
invokeFirst(Method method,
Object[] args) |
protected abstract Object |
invokeSecond(Method method,
Object[] args) |
void |
setDecorator(T decorator) |
void |
setReturnDecoratorResult(boolean returnDecoratorResult) |
protected boolean |
shouldReturnDecoratorResult() |
public void setDecorator(T decorator)
public T getTarget()
public T getDecorator()
public final Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
protected abstract Object invokeFirst(Method method, Object[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
protected abstract Object invokeSecond(Method method, Object[] args) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
public void setReturnDecoratorResult(boolean returnDecoratorResult)
protected boolean shouldReturnDecoratorResult()
Copyright © 2007–2016. All rights reserved.