info.magnolia.nodebuilder
Class RecursiveOp

java.lang.Object
  extended by info.magnolia.nodebuilder.AbstractNodeOperation
      extended by info.magnolia.nodebuilder.RecursiveOp
All Implemented Interfaces:
NodeOperation

public class RecursiveOp
extends AbstractNodeOperation

Visits the hierarchy recursively and executes the operations on all nodes matching the filter. The recursion does not stop if a node does not match! The class has some static methods to build recursive operations easily.

Version:
$Id: RecursiveOp.java 49263 2011-09-14 08:14:14Z dlipp $
Author:
pbracher

Constructor Summary
RecursiveOp(Content.ContentFilter filter, NodeOperation[] childrenOps)
          Visits the hierarchy recursively and executes the operations on all nodes matching the filter.
 
Method Summary
protected  Content doExec(Content context, ErrorHandler errorHandler)
           
static NodeOperation recursive(Content.ContentFilter filter, NodeOperation... childrenOps)
           
static NodeOperation recursive(ItemType type, NodeOperation... childrenOps)
          Visits the hierarchy recursively and executes the operations on all nodes matching a certain type.
static NodeOperation recursive(NodeOperation... childrenOps)
          Visits the hierarchy recursively and executes the operations on all nodes excluding meta data and jcr base nodes.
static NodeOperation recursive(String type, NodeOperation... childrenOps)
          Visits the hierarchy recursively and executes the operations on all nodes matching a certain type.
 
Methods inherited from class info.magnolia.nodebuilder.AbstractNodeOperation
exec, then
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecursiveOp

public RecursiveOp(Content.ContentFilter filter,
                   NodeOperation[] childrenOps)
Visits the hierarchy recursively and executes the operations on all nodes matching the filter. The recursion does not stop if a node does not match!

Method Detail

recursive

public static NodeOperation recursive(NodeOperation... childrenOps)
Visits the hierarchy recursively and executes the operations on all nodes excluding meta data and jcr base nodes. The recursion does not stop if a node does not match!


recursive

public static NodeOperation recursive(String type,
                                      NodeOperation... childrenOps)
Visits the hierarchy recursively and executes the operations on all nodes matching a certain type. The recursion does not stop if a node does not match!


recursive

public static NodeOperation recursive(ItemType type,
                                      NodeOperation... childrenOps)
Visits the hierarchy recursively and executes the operations on all nodes matching a certain type. The recursion does not stop if a node does not match!


recursive

public static NodeOperation recursive(Content.ContentFilter filter,
                                      NodeOperation... childrenOps)

doExec

protected Content doExec(Content context,
                         ErrorHandler errorHandler)
                  throws javax.jcr.RepositoryException
Specified by:
doExec in class AbstractNodeOperation
Returns:
the node that should now be used as the context for subsequent operations
Throws:
javax.jcr.RepositoryException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.