com.day.cq.wcm.foundation.forms
Class MergedMultiResource

java.lang.Object
  extended by org.apache.sling.api.adapter.SlingAdaptable
      extended by org.apache.sling.api.resource.AbstractResource
          extended by org.apache.sling.api.resource.SyntheticResource
              extended by com.day.cq.wcm.foundation.forms.MergedMultiResource
All Implemented Interfaces:
Adaptable, Resource

public class MergedMultiResource
extends SyntheticResource

MergedMultiResource is a synthetic resource that presents a merged view on multiple resources. This is done by providing a ValueMap in adaptTo(Class) that merges the values of all resources, ie. provide a null value for a key if the value is not the same in all resurces and only present a value if that one is present in exactly all of the resources.


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
 
Constructor Summary
MergedMultiResource(List<Resource> resources)
           
 
Method Summary
<AdapterType>
AdapterType
adaptTo(Class<AdapterType> type)
          Calls into the registered AdapterManager to adapt this object to the desired type.
 
Methods inherited from class org.apache.sling.api.resource.SyntheticResource
getPath, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, toString
 
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getChildren, getName, getParent, isResourceType, listChildren
 
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MergedMultiResource

public MergedMultiResource(List<Resource> resources)
Method Detail

adaptTo

public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
Description copied from class: SlingAdaptable
Calls into the registered AdapterManager to adapt this object to the desired type.

This method implements a cache of adapters to improve performance. That is repeated calls to this method with the same class will result in the same object to be returned.

Specified by:
adaptTo in interface Adaptable
Overrides:
adaptTo in class SlingAdaptable
Type Parameters:
AdapterType - The generic type to which this resource is adapted to
Parameters:
type - The Class object of the target type, such as javax.jcr.Node.class or java.io.File.class
Returns:
The adapter target or null if the resource cannot adapt to the requested type


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.