public class ValueMapResource extends SyntheticResource
SyntheticResource that will return the passed ValueMap when this
resource is adapted to ValueMap.RESOURCE_TYPE_NON_EXISTING| Constructor and Description |
|---|
ValueMapResource(ResourceResolver resourceResolver,
ResourceMetadata rm,
java.lang.String resourceType)
Instantiates with an empty ValueMap initially.
|
ValueMapResource(ResourceResolver resourceResolver,
ResourceMetadata rm,
java.lang.String resourceType,
ValueMap vm)
Instantiates with the given ValueMap.
|
ValueMapResource(ResourceResolver resourceResolver,
ResourceMetadata rm,
java.lang.String resourceType,
ValueMap vm,
java.util.Collection<Resource> children)
Instantiates with the given child resources.
|
ValueMapResource(ResourceResolver resourceResolver,
java.lang.String path,
java.lang.String resourceType)
Instantiates with an empty ValueMap initially.
|
ValueMapResource(ResourceResolver resourceResolver,
java.lang.String path,
java.lang.String resourceType,
ValueMap vm)
Instantiates with the given ValueMap.
|
ValueMapResource(ResourceResolver resourceResolver,
java.lang.String path,
java.lang.String resourceType,
ValueMap vm,
java.util.Collection<Resource> children)
Instantiates with the given child resources.
|
| Modifier and Type | Method and Description |
|---|---|
<Type> Type |
adaptTo(java.lang.Class<Type> type)
Calls into the registered
AdapterManager to adapt this object to
the desired type. |
Resource |
getChild(java.lang.String relPath)
Returns the indicated child of this resource.
|
java.lang.Iterable<Resource> |
getChildren()
Returns an iterable of the direct children of this resource.
|
boolean |
hasChildren()
Checks to see if there are direct children of this resource by invoking
ResourceResolver.hasChildren(Resource). |
java.util.Iterator<Resource> |
listChildren()
Returns an iterator on the direct child resources.
|
getPath, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, toStringgetName, getParent, getValueMap, isResourceTypesetAdapterManager, unsetAdapterManagerpublic ValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType)
resourceResolver - The resource resolverpath - The resource pathresourceType - The resource typepublic ValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, @Nonnull ValueMap vm)
resourceResolver - The resource resolverpath - The resource pathresourceType - The resource typevm - The ValueMap of the resourcepublic ValueMapResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType, @Nonnull ValueMap vm, @CheckForNull java.util.Collection<Resource> children)
resourceResolver - The resource resolverpath - The resource pathresourceType - The resource typevm - The ValueMap of the resourcechildren - The children of the resourcepublic ValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType)
resourceResolver - The resource resolverrm - The resource meta dataresourceType - The resource typepublic ValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, @Nonnull ValueMap vm)
resourceResolver - The resource resolverrm - The resource meta dataresourceType - The resource typevm - The ValueMap of the resourcepublic ValueMapResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType, @Nonnull ValueMap vm, @CheckForNull java.util.Collection<Resource> children)
resourceResolver - The resource resolverrm - The resource meta dataresourceType - The resource typevm - The ValueMap of the resourcechildren - The children of the resourcepublic <Type> Type adaptTo(java.lang.Class<Type> type)
SlingAdaptableAdapterManager 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.
adaptTo in interface AdaptableadaptTo in class SlingAdaptableType - The generic type to which this resource is adapted
totype - The Class object of the target type, such as
javax.jcr.Node.class or
java.io.File.classnull if the resource cannot
adapt to the requested typepublic Resource getChild(java.lang.String relPath)
AbstractResource
This method is implemented calling the
ResourceResolver.getResource(Resource, String) method. As such
the relPath argument 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.
getChild in interface ResourcegetChild in class AbstractResourcerelPath - relative path to the child resourcenullResourceResolver.getResource(Resource, String)public java.util.Iterator<Resource> listChildren()
AbstractResource
This method is implemented calling the
ResourceResolver.listChildren(Resource) method.
Implementations should not generally overwrite this method without calling this base class implementation.
listChildren in interface ResourcelistChildren in class AbstractResourceResourceResolver.listChildren(Resource)public java.lang.Iterable<Resource> getChildren()
Resource
This method is a convenience and returns exactly the same resources as
calling getResourceResolver().getChildren(resource).
getChildren in interface ResourcegetChildren in class AbstractResourceResource.getChildren()public boolean hasChildren()
AbstractResourceResourceResolver.hasChildren(Resource).hasChildren in interface ResourcehasChildren in class AbstractResourcetrue if the resource has any child resourcesCopyright © 2010 - 2023 Adobe. All Rights Reserved