|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springbyexample.jcr.JcrRecurser
@Component public class JcrRecurser
Used for recursing through the repository. It also can start at a specified path (default is the root node) and also matching on specific nodes if a node name is specified. If no specific node names are specified, all nodes will be processed.
Field Summary | |
---|---|
protected Set<String> |
matchingNodes
|
protected String |
path
|
protected String |
pathDelim
|
protected org.springmodules.jcr.JcrTemplate |
template
|
Constructor Summary | |
---|---|
JcrRecurser()
Constructor. |
|
JcrRecurser(Set<String> matchingNodes)
Constructor. |
|
JcrRecurser(String path)
Constructor. |
|
JcrRecurser(String path,
Set<String> matchingNodes)
Constructor. |
Method Summary | |
---|---|
void |
addMatchingNode(String nodeName)
Add matching node. |
Set<String> |
getMatchingNodeSet()
Gets matching names. |
String |
getPath()
Gets relative path from root to start recursing. |
String |
getPathDelim()
Gets path delimiter. |
javax.jcr.Node |
getStartNode(javax.jcr.Node root)
Gets start node. |
org.springmodules.jcr.JcrTemplate |
getTemplate()
Gets JCR template. |
void |
recurse(JcrNodeCallback callback)
Recurses through all nodes processing the callback when a matching node is found. |
protected void |
recurseNodes(javax.jcr.Session session,
org.springmodules.jcr.JcrConstants jcrConstants,
javax.jcr.Node node,
JcrNodeCallback callback)
Recurse nodes. |
void |
setMatchingNodeSet(Set<String> matchingNodes)
Sets matching names. |
void |
setPath(String path)
Sets relative path from root to start recursing. |
void |
setPathDelim(String pathDelim)
Sets path delimiter. |
void |
setTemplate(org.springmodules.jcr.JcrTemplate template)
Sets JCR template. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Autowired protected org.springmodules.jcr.JcrTemplate template
protected String path
protected String pathDelim
protected Set<String> matchingNodes
Constructor Detail |
---|
public JcrRecurser()
public JcrRecurser(String path)
path
- Relative path from root to start recursing.public JcrRecurser(Set<String> matchingNodes)
matchingNodes
- Set
of node names to match for callbacks.public JcrRecurser(String path, Set<String> matchingNodes)
path
- Relative path from root to start recursing.matchingNodes
- Set
of node names to match for callbacks.Method Detail |
---|
public org.springmodules.jcr.JcrTemplate getTemplate()
public void setTemplate(org.springmodules.jcr.JcrTemplate template)
public String getPath()
public void setPath(String path)
public String getPathDelim()
public void setPathDelim(String pathDelim)
public Set<String> getMatchingNodeSet()
JcrNodeCallback
will be
run. If no specific node names are specified,
all nodes will be processed.
public void setMatchingNodeSet(Set<String> matchingNodes)
JcrNodeCallback
will be
run. If no specific node names are specified,
all nodes will be processed.
public void addMatchingNode(String nodeName)
public void recurse(JcrNodeCallback callback)
public javax.jcr.Node getStartNode(javax.jcr.Node root) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
protected void recurseNodes(javax.jcr.Session session, org.springmodules.jcr.JcrConstants jcrConstants, javax.jcr.Node node, JcrNodeCallback callback) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |