|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.jcr.JcrTools
public class JcrTools
Utility methods for working with JCR nodes.
Constructor Summary | |
---|---|
JcrTools()
|
Method Summary | |
---|---|
Node |
findOrCreateChild(Node parent,
String name)
Get or create a node with the specified node under the specified parent node. |
Node |
findOrCreateChild(Node parent,
String name,
String nodeType)
Get or create a node with the specified node and node type under the specified parent node. |
Node |
findOrCreateNode(Node parentNode,
String path,
String defaultNodeType,
String finalNodeType)
Get or create a node at the specified path. |
Node |
findOrCreateNode(Session session,
String path)
Get or create a node at the specified path. |
Node |
findOrCreateNode(Session session,
String path,
String nodeType)
Get or create a node at the specified path and node type. |
Node |
findOrCreateNode(Session session,
String path,
String defaultNodeType,
String finalNodeType)
Get or create a node at the specified path. |
Node |
getNode(Node node,
String relativePath,
boolean required)
Get the node under a specified node at a location defined by the specified relative path. |
String |
getReadable(Node node)
Get the readable string form for a specified node. |
int |
removeAllChildren(Node node)
Remove all children from the specified node |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JcrTools()
Method Detail |
---|
public int removeAllChildren(Node node) throws RepositoryException
node
-
RepositoryException
IllegalArgumentException
- if the node argument is nullpublic Node getNode(Node node, String relativePath, boolean required) throws RepositoryException
node
- a parent node from which to obtain a node relative to. may not be nullrelativePath
- the path of the desired node. may not be nullrequired
- true if node is required to exist under the given node.
RepositoryException
IllegalArgumentException
- if the node, relativePath or problems argument is nullpublic String getReadable(Node node)
node
- the node to obtain the readable string form. may be null
public Node findOrCreateNode(Session session, String path) throws RepositoryException
session
- the JCR session. may not be nullpath
- the path of the desired node to be found or created. may not be null
RepositoryException
IllegalArgumentException
- if either the session or path argument is nullpublic Node findOrCreateNode(Session session, String path, String nodeType) throws RepositoryException
session
- the JCR session. may not be nullpath
- the path of the desired node to be found or created. may not be nullnodeType
- the node type. may be null
RepositoryException
IllegalArgumentException
- if either the session or path argument is nullpublic Node findOrCreateNode(Session session, String path, String defaultNodeType, String finalNodeType) throws RepositoryException
session
- the JCR session. may not be nullpath
- the path of the desired node to be found or created. may not be nulldefaultNodeType
- the default node type. may be nullfinalNodeType
- the optional final node type. may be null
RepositoryException
IllegalArgumentException
- if either the session or path argument is nullpublic Node findOrCreateNode(Node parentNode, String path, String defaultNodeType, String finalNodeType) throws RepositoryException
parentNode
- the parent node. may not be nullpath
- the path of the desired child node. may not be nulldefaultNodeType
- the default node type. may be nullfinalNodeType
- the optional final node type. may be null
RepositoryException
IllegalArgumentException
- if either the parentNode or path argument is nullpublic Node findOrCreateChild(Node parent, String name) throws RepositoryException
parent
- the parent node. may not be nullname
- the name of the child node. may not be null
RepositoryException
IllegalArgumentException
- if either the parent or name argument is nullpublic Node findOrCreateChild(Node parent, String name, String nodeType) throws RepositoryException
parent
- the parent node. may not be nullname
- the name of the child node. may not be nullnodeType
- the node type. may be null
RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |