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

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

public class MergeCollectionReturnValueHandler
extends Object
implements DelegateReturnValueHandler

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

supports(java.lang.Class, java.util.List) method will return true only of returnType is of Collection sub type.

Author:
Tsolak Petrosian

Constructor Summary
MergeCollectionReturnValueHandler()
           
 
Method Summary
 Class<? extends Collection> getCollectionClass()
           
 Object getReturnValue(Class<? extends Object> returnType, List<Object> returnValues)
           
 void setCollectionClass(Class<? extends Collection> collectionClass)
           
 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

MergeCollectionReturnValueHandler

public MergeCollectionReturnValueHandler()
Method Detail

getCollectionClass

public Class<? extends Collection> getCollectionClass()

setCollectionClass

public void setCollectionClass(Class<? extends Collection> collectionClass)

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.