|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.sling.api.resource.SyntheticResource
public class SyntheticResource
The 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.
Field Summary |
---|
Fields inherited from interface org.apache.sling.api.resource.Resource |
---|
RESOURCE_TYPE_NON_EXISTING |
Constructor Summary | |
---|---|
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 . |
Method Summary | ||
---|---|---|
|
adaptTo(java.lang.Class<Type> type)
Returns null because synthetic resources have no actual
data and thus may not adapt to anything else. |
|
java.lang.String |
getPath()
This resource's path - for now that could be a JCR path. |
|
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. |
|
protected void |
setResourceType(java.lang.String resourceType)
|
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SyntheticResource(ResourceResolver resourceResolver, java.lang.String path, java.lang.String resourceType)
path
and
resourceType
.
public SyntheticResource(ResourceResolver resourceResolver, ResourceMetadata rm, java.lang.String resourceType)
ResourceMetadata
and resourceType
.
Method Detail |
---|
public java.lang.String getPath()
Resource
getPath
in interface Resource
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 the Resource.RESOURCE_TYPE_NON_EXISTING
.
getResourceType
in interface Resource
protected void setResourceType(java.lang.String resourceType)
public java.lang.String getResourceSuperType()
getResourceSuperType
in interface Resource
public ResourceMetadata getResourceMetadata()
ResourceMetadata.RESOLUTION_PATH
property.
getResourceMetadata
in interface Resource
ResourceMetadata
public ResourceResolver getResourceResolver()
ResourceResolver
with which this synthetic resource
is related or null
if none.
getResourceResolver
in interface Resource
public <Type> Type adaptTo(java.lang.Class<Type> type)
null
because synthetic resources have no actual
data and thus may not adapt to anything else.
adaptTo
in interface Adaptable
Type
- The generic type to which this resource is adapted
totype
- The Class object of the target type, such as
Node.class
null
if the resource cannot
adapt to the requested typepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |