org.fest.reflect.field.decorator
Class DecoratorInvocationHandler<T>

java.lang.Object
  extended by org.fest.reflect.field.decorator.DecoratorInvocationHandler<T>
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
PostDecorator, PreDecorator

public abstract class DecoratorInvocationHandler<T>
extends Object
implements InvocationHandler

Author:
Ivan Hristov

Constructor Summary
DecoratorInvocationHandler(T target, T decorator)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoratorInvocationHandler

public DecoratorInvocationHandler(T target,
                                  T decorator)
Method Detail

setDecorator

public void setDecorator(T decorator)

getTarget

public T getTarget()

getDecorator

public T getDecorator()

invoke

public final Object invoke(Object proxy,
                           Method method,
                           Object[] args)
                    throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

invokeFirst

protected abstract Object invokeFirst(Method method,
                                      Object[] args)
                               throws IllegalArgumentException,
                                      IllegalAccessException,
                                      InvocationTargetException
Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException

invokeSecond

protected abstract Object invokeSecond(Method method,
                                       Object[] args)
                                throws IllegalArgumentException,
                                       IllegalAccessException,
                                       InvocationTargetException
Throws:
IllegalArgumentException
IllegalAccessException
InvocationTargetException

getResult

protected abstract Object getResult(Object firstResult,
                                    Object secondResult)

setReturnDecoratorResult

public void setReturnDecoratorResult(boolean returnDecoratorResult)

shouldReturnDecoratorResult

protected boolean shouldReturnDecoratorResult()


Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.