Package com.adobe.granite.ui.components
Class ValueMapResourceWrapper
java.lang.Object
org.apache.sling.api.resource.ResourceWrapper
com.adobe.granite.ui.components.ValueMapResourceWrapper
A resource wrapper that wraps an underlying resource with an empty
ValueMap}, which can be modified accordingly. It is used for the
scenario where we want to control the ValueMap returned by a resource.-
Field Summary
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING -
Constructor Summary
ConstructorsConstructorDescriptionValueMapResourceWrapper(Resource resource, String resourceType) Instantiates a new wrapper. -
Method Summary
Modifier and TypeMethodDescription<AdapterType>
AdapterTypeReturns the value of callingadaptToon thewrapped resource.Returns the value of callinggetResourceTypeon thewrapped resource.Returns a value map for this resource.Methods inherited from class org.apache.sling.api.resource.ResourceWrapper
getChild, getChildren, getName, getParent, getPath, getResource, getResourceMetadata, getResourceResolver, getResourceSuperType, hasChildren, isResourceType, listChildren, toString
-
Constructor Details
-
ValueMapResourceWrapper
Instantiates a new wrapper.- Parameters:
resource- The resource to wrapresourceType- The resource type of the resource wrapper
-
-
Method Details
-
getResourceType
Description copied from class:ResourceWrapperReturns the value of callinggetResourceTypeon thewrapped resource.- Specified by:
getResourceTypein interfaceResource- Overrides:
getResourceTypein classResourceWrapper- Returns:
- The resource type
-
adaptTo
Description copied from class:ResourceWrapperReturns the value of callingadaptToon thewrapped resource.- Specified by:
adaptToin interfaceAdaptable- Overrides:
adaptToin classResourceWrapper- Type Parameters:
AdapterType- The generic type to which this object is adapted to- Parameters:
type- The Class object of the target type, such asjavax.jcr.Node.classorjava.io.File.class- Returns:
- The adapter target or
nullif the object cannot adapt to the requested type
-
getValueMap
Description copied from interface:ResourceReturns a value map for this resource. The value map allows to read the properties of the resource.- Specified by:
getValueMapin interfaceResource- Overrides:
getValueMapin classResourceWrapper- Returns:
- A value map
- See Also:
-