org.equilibriums.aop.utils.interceptor.composite.handlers
Class MergeMapReturnValueHandler

java.lang.Object
  extended by org.equilibriums.aop.utils.interceptor.composite.handlers.MergeMapReturnValueHandler
All Implemented Interfaces:
ReturnValueHandler

public class MergeMapReturnValueHandler
extends Object
implements ReturnValueHandler

Assumes returnType is of Map type. Will merge all Map return values from delegates into single Map return value.

supports(java.lang.Class, java.lang.Object[]) method will return true only of returnType is of Map sub type.

Author:
Tsolak Petrosian

Constructor Summary
MergeMapReturnValueHandler()
           
 
Method Summary
 Class<? extends Map> getMapClass()
           
 Object getReturnValue(Class<? extends Object> returnType, Object[] returnValues)
           
 void setMapClass(Class<? extends Map> mapClass)
           
 boolean supports(Class<? extends Object> returnType, Object[] returnValues)
          Called by CompositeDelegateInterceptor 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

MergeMapReturnValueHandler

public MergeMapReturnValueHandler()
Method Detail

getMapClass

public Class<? extends Map> getMapClass()

setMapClass

public void setMapClass(Class<? extends Map> mapClass)

supports

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

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

getReturnValue

public Object getReturnValue(Class<? extends Object> returnType,
                             Object[] returnValues)
Specified by:
getReturnValue in interface ReturnValueHandler


Copyright © 2011. All Rights Reserved.