public class SyntheticResource extends AbstractResource
SyntheticResource
class is a simple implementation of the
Resource
interface which may be used to provide a resource
object which has no actual resource data.RESOURCE_TYPE_NON_EXISTING
Constructor and Description |
---|
SyntheticResource(ResourceResolver resourceResolver,
ResourceMetadata rm,
java.lang.String resourceType)
Creates a synthetic resource with the given
ResourceMetadata
and resourceType . |
SyntheticResource(ResourceResolver resourceResolver,
java.lang.String path,
java.lang.String resourceType)
Creates a synthetic resource with the given
path and
resourceType . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPath()
Returns the absolute path of this resource in the resource tree.
|
ResourceMetadata |
getResourceMetadata()
Returns a resource metadata object containing just the path of this
resource as the
ResourceMetadata.RESOLUTION_PATH property. |
ResourceResolver |
getResourceResolver()
Returns the
ResourceResolver with which this synthetic resource
is related or null if none. |
java.lang.String |
getResourceSuperType()
Synthetic resources by default do not have a resource super type.
|
java.lang.String |
getResourceType()
The resource type is meant to point to rendering/processing scripts,
editing dialogs, etc.
|
java.lang.String |
toString() |
getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
adaptTo, setAdapterManager, unsetAdapterManager
public SyntheticResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType)
path
and
resourceType
.resourceResolver
- The resource resolverpath
- The resource pathresourceType
- The type of the resourcepublic SyntheticResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType)
ResourceMetadata
and resourceType
.resourceResolver
- The resource resolverrm
- The resource meta dataresourceType
- The type of the resource@Nonnull public java.lang.String getPath()
Resource
Resource.getPath()
@Nonnull public java.lang.String getResourceType()
Resource
ResourceResolver
is free to set this to any suitable value such
as the primary node type of the JCR node from which the resource is
created.
If the resource instance represents a resource which is not actually
existing, this method returns Resource.RESOURCE_TYPE_NON_EXISTING
.
Resource.getResourceType()
public java.lang.String getResourceSuperType()
null
.@Nonnull public ResourceMetadata getResourceMetadata()
ResourceMetadata.RESOLUTION_PATH
property.ResourceMetadata
@Nonnull public ResourceResolver getResourceResolver()
ResourceResolver
with which this synthetic resource
is related or null
if none.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 The Apache Software Foundation. All rights reserved.