org.equilibriums.aop.utils.interceptor.delegate.handlers
Class IndexedReturnValueHandler

java.lang.Object
  extended by org.equilibriums.aop.utils.interceptor.delegate.handlers.IndexedReturnValueHandler
All Implemented Interfaces:
DelegateReturnValueHandler

public class IndexedReturnValueHandler
extends Object
implements DelegateReturnValueHandler

Simply retuns element from returnValues at specified index.

supports(java.lang.Class, java.util.List) method will always return true.

Author:
Tsolak Petrosian

Constructor Summary
IndexedReturnValueHandler()
           
 
Method Summary
 Integer getIndex()
           
 Object getReturnValue(Class<? extends Object> returnType, List<Object> returnValues)
           
 void setIndex(Integer index)
           
 boolean supports(Class<? extends Object> returnType, List<Object> returnValues)
          Called by DelegateInterceptor after all delegates are invoked with their retun values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedReturnValueHandler

public IndexedReturnValueHandler()
Method Detail

getIndex

public Integer getIndex()

setIndex

public void setIndex(Integer index)

supports

public boolean supports(Class<? extends Object> returnType,
                        List<Object> returnValues)
Description copied from interface: DelegateReturnValueHandler
Called by DelegateInterceptor after all delegates are invoked with their retun values.

Specified by:
supports in interface DelegateReturnValueHandler
Returns:
If true than getReturnValue will be called with same returnType and returnValues.

getReturnValue

public Object getReturnValue(Class<? extends Object> returnType,
                             List<Object> returnValues)
Specified by:
getReturnValue in interface DelegateReturnValueHandler


Copyright © 2011. All Rights Reserved.