|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.api.resource.ResourceWrapper
public class ResourceWrapper
The ResourceWrapper
is a wrapper for any Resource
delegating all method calls to the wrapped resource by default. Extensions of
this class may overwrite any method to return different values as
appropriate.
Field Summary |
---|
Fields inherited from interface org.apache.sling.api.resource.Resource |
---|
RESOURCE_TYPE_NON_EXISTING |
Constructor Summary | |
---|---|
ResourceWrapper(Resource resource)
Creates a new wrapper instance delegating all method calls to the given resource . |
Method Summary | ||
---|---|---|
|
adaptTo(Class<AdapterType> type)
Returns the value of calling adaptTo on the
wrapped resource . |
|
Resource |
getChild(String relPath)
Returns the value of calling getChild on the
wrapped resource . |
|
String |
getName()
Returns the value of calling getName on the
wrapped resource . |
|
Resource |
getParent()
Returns the value of calling getParent on the
wrapped resource . |
|
String |
getPath()
Returns the value of calling getPath on the
wrapped resource . |
|
Resource |
getResource()
Returns the Resource wrapped by this instance. |
|
ResourceMetadata |
getResourceMetadata()
Returns the value of calling getResourceMetadata on the
wrapped resource . |
|
ResourceResolver |
getResourceResolver()
Returns the value of calling getResourceResolver on the
wrapped resource . |
|
String |
getResourceSuperType()
Returns the value of calling getResourceSuperType on the
wrapped resource . |
|
String |
getResourceType()
Returns the value of calling getResourceType on the
wrapped resource . |
|
boolean |
isResourceType(String resourceType)
Returns the value of calling isResourceType on the
wrapped resource . |
|
Iterator<Resource> |
listChildren()
Returns the value of calling listChildren on the
wrapped resource . |
|
String |
toString()
Returns a string representation of this wrapper consisting of the class' simple name, the resource type and
path as well as the string representation of the
wrapped resource . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourceWrapper(Resource resource)
resource
.
Method Detail |
---|
public Resource getResource()
Resource
wrapped by this instance. This method
can be overwritten by subclasses if required. All methods implemented by
this class use this method to get the resource object.
public String getPath()
getPath
on the
wrapped resource
.
getPath
in interface Resource
public String getName()
getName
on the
wrapped resource
.
getName
in interface Resource
public Resource getParent()
getParent
on the
wrapped resource
.
getParent
in interface Resource
public Resource getChild(String relPath)
getChild
on the
wrapped resource
.
getChild
in interface Resource
ResourceResolver.getResource(Resource, String)
public Iterator<Resource> listChildren()
listChildren
on the
wrapped resource
.
listChildren
in interface Resource
ResourceResolver.listChildren(Resource)
public ResourceMetadata getResourceMetadata()
getResourceMetadata
on the
wrapped resource
.
getResourceMetadata
in interface Resource
ResourceMetadata
public ResourceResolver getResourceResolver()
getResourceResolver
on the
wrapped resource
.
getResourceResolver
in interface Resource
public String getResourceType()
getResourceType
on the
wrapped resource
.
getResourceType
in interface Resource
public String getResourceSuperType()
getResourceSuperType
on the
wrapped resource
.
getResourceSuperType
in interface Resource
public boolean isResourceType(String resourceType)
isResourceType
on the
wrapped resource
.
isResourceType
in interface Resource
resourceType
- The resource type to check this resource against.
true
if the resource type or any of the resource's
super type(s) equals the given resource type. false
is also returned if resourceType
is
null
.public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
adaptTo
on the
wrapped resource
.
adaptTo
in interface Adaptable
AdapterType
- 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 String toString()
resource type
and
path
as well as the string representation of the
wrapped resource
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |