1 30 package com.genimen.djeneric.tools.scriptengine.core.nodes; 31 32 import java.util.ArrayList ; 33 34 import com.genimen.djeneric.tools.scriptengine.core.DjScriptParserEngine; 35 import com.genimen.djeneric.tools.scriptengine.core.SimpleNode; 36 import com.genimen.djeneric.tools.scriptengine.core.util.DjScriptCompileTimeScope; 37 import com.genimen.djeneric.tools.scriptengine.core.util.DjScriptExecutionException; 38 39 public class ActionListNode extends SimpleNode 40 { 41 42 private ArrayList _rootActions = new ArrayList (); 43 44 public ActionListNode(int i) 45 { 46 super(i); 47 } 48 49 public ActionListNode(DjScriptParserEngine p, int i) 50 { 51 super(p, i); 52 } 53 54 public void addRootAction(String actionName) 55 { 56 _rootActions.add(actionName); 57 } 58 59 public String getName() 60 { 61 return "actionlist"; 62 } 63 64 public String toString() 65 { 66 StringBuffer result = new StringBuffer (100); 67 for (int i = 0; i < _rootActions.size(); i++) 68 { 69 if (i != 0) result.append(", "); 70 result.append(_rootActions.get(i).toString()); 71 } 72 73 return result.toString(); 74 } 75 76 public String getFirstActionName() 77 { 78 if (_rootActions.size() == 0) return null; 79 return _rootActions.get(0).toString(); 80 } 81 82 public void validateScript(DjScriptCompileTimeScope ctxt) throws DjScriptExecutionException 83 { 84 for (int i = 0; i < _rootActions.size(); i++) 85 { 86 ctxt.getAction(_rootActions.get(i).toString(), this); 87 } 88 super.validateScript(ctxt); 89 } 90 91 } | Popular Tags |