1 16 package org.apache.cocoon.components.treeprocessor; 17 18 import org.apache.cocoon.environment.Environment; 19 20 import java.util.Map ; 21 22 27 public abstract class AbstractParentProcessingNode extends AbstractProcessingNode { 28 29 35 protected final boolean invokeNodes(ProcessingNode[] nodes, 36 Environment env, 37 InvokeContext context, 38 String currentName, 39 Map currentMap) 40 throws Exception { 41 42 context.pushMap(currentName,currentMap); 43 44 try { 45 for (int i = 0; i < nodes.length; i++) { 46 if (nodes[i].invoke(env, context)) { 47 return true; 49 } 50 } 51 } finally { 52 context.popMap(); 54 } 55 56 return false; 57 } 58 59 62 protected final boolean invokeNodes (ProcessingNode[] nodes, 63 Environment env, 64 InvokeContext context) 65 throws Exception { 66 67 for (int i = 0; i < nodes.length; i++) { 68 if (nodes[i].invoke(env, context)) { 69 return true; 70 } 71 } 72 73 return false; 74 } 75 } 76 | Popular Tags |