org.apache.sling.commons.testing.sling
Class MockResource

java.lang.Object
  extended by org.apache.sling.api.adapter.SlingAdaptable
      extended by org.apache.sling.api.resource.AbstractResource
          extended by org.apache.sling.api.resource.SyntheticResource
              extended by org.apache.sling.commons.testing.sling.MockResource
All Implemented Interfaces:
Adaptable, Resource

public class MockResource
extends SyntheticResource


Field Summary
 
Fields inherited from interface org.apache.sling.api.resource.Resource
RESOURCE_TYPE_NON_EXISTING
 
Constructor Summary
MockResource(ResourceResolver resourceResolver, String path, String resourceType)
           
MockResource(ResourceResolver resourceResolver, String path, String resourceType, String resourceSuperType)
           
 
Method Summary
 String getResourceSuperType()
          Synthetic resources by default do not have a resource super type.
 String getResourceType()
          The resource type is meant to point to rendering/processing scripts, editing dialogs, etc.
 void setResourceSuperType(String resourceSuperType)
           
 void setResourceType(String resourceType)
           
 
Methods inherited from class org.apache.sling.api.resource.SyntheticResource
getPath, getResourceMetadata, getResourceResolver, toString
 
Methods inherited from class org.apache.sling.api.resource.AbstractResource
getChild, getName, getParent, isResourceType, listChildren
 
Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable
adaptTo, setAdapterManager, unsetAdapterManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.sling.api.adapter.Adaptable
adaptTo
 

Constructor Detail

MockResource

public MockResource(ResourceResolver resourceResolver,
                    String path,
                    String resourceType)

MockResource

public MockResource(ResourceResolver resourceResolver,
                    String path,
                    String resourceType,
                    String resourceSuperType)
Method Detail

getResourceType

public String getResourceType()
Description copied from interface: Resource
The resource type is meant to point to rendering/processing scripts, editing dialogs, etc. It is usually a path in the repository, where scripts and other tools definitions are found, but the 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.

Specified by:
getResourceType in interface Resource
Overrides:
getResourceType in class SyntheticResource
See Also:
Resource.getResourceType()

setResourceType

public void setResourceType(String resourceType)

getResourceSuperType

public String getResourceSuperType()
Description copied from class: SyntheticResource
Synthetic resources by default do not have a resource super type.

Specified by:
getResourceSuperType in interface Resource
Overrides:
getResourceSuperType in class SyntheticResource

setResourceSuperType

public void setResourceSuperType(String resourceSuperType)


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.