|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.scit.sling.test.ResourceNode
public class ResourceNode
This class is used to represent a JRC subtree. You can use it directly to create a tree then build a MockResourceResolver
via MockResourceFactory.buildMockRepository(ResourceNode)
or you can use the provided MockResourceFactory#buildRepositoryFromJson(String, java.io.InputStream)
factory methods.
base = new ResourceNode("/content/geometrixx/en", "products");
base.addProperty("jcr:createdBy", "system");
base.addProperty("jcr:primaryType", "cq:Page");
jcrContent = new ResourceNode("base", "jcr:content");
base.addChild(jcrContent);
jcrContent.addProperty("sling:resourceType", "geometrixx/components/contentpage");
jcrContent.addProperty("jcr:createdBy", "system");
Constructor Summary | |
---|---|
ResourceNode(ResourceNode parent,
String name)
|
|
ResourceNode(String basePath,
String name)
Create a root node that represents a location somewhere on a resource tree. |
Method Summary | |
---|---|
void |
addChild(ResourceNode node)
Add a child and possibly another subtree |
void |
addProperty(String name,
Object value)
Add a property node |
String |
fullContent(int depth)
|
LinkedList<ResourceNode> |
getChildren()
|
String |
getPath()
|
org.apache.sling.api.resource.ValueMap |
getProperties()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourceNode(String basePath, String name)
basePath
- the parent path of this node (blank if it's meant to be the root)name
- the name of this nodepublic ResourceNode(ResourceNode parent, String name)
Method Detail |
---|
public LinkedList<ResourceNode> getChildren()
public void addProperty(String name, Object value)
name
- the property namevalue
- the valuepublic String getPath()
public String toString()
toString
in class Object
public String fullContent(int depth)
public void addChild(ResourceNode node)
node
- public org.apache.sling.api.resource.ValueMap getProperties()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |