Package com.adobe.aemds.guide.utils
Class GuideValueMapResource
- java.lang.Object
-
- org.apache.sling.api.adapter.SlingAdaptable
-
- org.apache.sling.api.resource.AbstractResource
-
- org.apache.sling.api.resource.SyntheticResource
-
- com.adobe.granite.ui.components.ds.ValueMapResource
-
- com.adobe.aemds.guide.utils.GuideValueMapResource
-
public class GuideValueMapResource extends ValueMapResource
An extension of ValueMapResource implementation that can return parent resource of this synthetic resource if passed through its constructor.
-
-
Field Summary
-
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
-
-
Constructor Summary
Constructors Constructor Description GuideValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, ValueMap vm, java.util.Collection<Resource> children, Resource parentResource)Creates aGuideValueMapResourcebased on provided parameters, with the ability to define the children and its parent.GuideValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, ValueMap vm, Resource parentResource)Creates aGuideValueMapResourcebased on provided parametersGuideValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, ValueMap vm, java.util.Collection<Resource> children, Resource parentResource)Creates aValueMapResourcebased on provided parameters, with the ability to define the childrenGuideValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, ValueMap vm, Resource parentResource)Creates aGuideValueMapResourcebased on provided parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <Type> TypeadaptTo(java.lang.Class<Type> type)Calls into the registeredAdapterManagerto adapt this object to the desiredtype.ResourcegetChild(java.lang.String relPath)Returns the indicated child of this resource.ResourcegetParent()Returns the parent resource of this resource.-
Methods inherited from class com.adobe.granite.ui.components.ds.ValueMapResource
getChildren, hasChildren, listChildren
-
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
getName, getValueMap, isResourceType
-
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
setAdapterManager, unsetAdapterManager
-
-
-
-
Constructor Detail
-
GuideValueMapResource
public GuideValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, ValueMap vm, Resource parentResource)
Creates aGuideValueMapResourcebased on provided parameters- Parameters:
resourceResolver- The resource resolverpath- The resource pathresourceType- The resource typevm- The properties of the resourceparentResource- parent resource of this synthetic resource.
-
GuideValueMapResource
public GuideValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, ValueMap vm, java.util.Collection<Resource> children, Resource parentResource)
Creates aGuideValueMapResourcebased on provided parameters, with the ability to define the children and its parent.- Parameters:
resourceResolver- The resource resolverpath- The resource pathresourceType- The resource typevm- The properties of the resourcechildren- The children of the resourceparentResource- parent resource of this synthetic resource.
-
GuideValueMapResource
public GuideValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, ValueMap vm, Resource parentResource)
Creates aGuideValueMapResourcebased on provided parameters- Parameters:
resourceResolver- The resource resolverrm- The resource meta dataresourceType- The resource typevm- The properties of the resourceparentResource- parent resource of this synthetic resource.
-
GuideValueMapResource
public GuideValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, ValueMap vm, java.util.Collection<Resource> children, Resource parentResource)
Creates aValueMapResourcebased on provided parameters, with the ability to define the children- Parameters:
resourceResolver- The resource resolverrm- The resource meta dataresourceType- The resource typevm- The properties of the resourcechildren- The children of the resourceparentResource- parent resource of this synthetic resource.
-
-
Method Detail
-
adaptTo
public <Type> Type adaptTo(java.lang.Class<Type> type)
Description copied from class:SlingAdaptableCalls into the registeredAdapterManagerto adapt this object to the desiredtype.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:
adaptToin interfaceAdaptable- Overrides:
adaptToin classValueMapResource- Type Parameters:
Type- The generic type to which this resource 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 resource cannot adapt to the requested type
-
getChild
public Resource getChild(java.lang.String relPath)
Description copied from class:AbstractResourceReturns the indicated child of this resource.This method is implemented calling the
ResourceResolver.getResource(Resource, String)method. As such therelPathargument may even be an absolute path or a path containing relative path segments.(current resource) and..(parent resource).Implementations should not generally overwrite this method without calling this base class implementation.
- Specified by:
getChildin interfaceResource- Overrides:
getChildin classValueMapResource- Parameters:
relPath- relative path to the child resource- Returns:
- The child resource or
null - See Also:
Resource.getChild(String)
-
getParent
public Resource getParent()
Description copied from class:AbstractResourceReturns the parent resource of this resource.This method is implemented calling the
ResourceResolver.getParent(Resource)method.- Specified by:
getParentin interfaceResource- Overrides:
getParentin classAbstractResource- Returns:
- The parent resource or
null. - See Also:
ResourceResolver.getParent(Resource)
-
-