1 package org.xmldb.xupdate.lexus.commands; 2 3 55 56 import org.w3c.dom.NodeList ; 57 58 import java.util.Hashtable ; 59 60 67 public class TempTree extends Object { 68 69 70 protected Hashtable variables = null; 71 72 73 79 public void addVariable(String name, NodeList tree) { 80 if (name == null) { 81 throw new IllegalArgumentException ("variable name must not be null !"); 82 } 83 if (tree == null) { 84 throw new IllegalArgumentException ("variable value must not be null !"); 85 } 86 variables.put(name, tree); 87 } 88 89 90 96 public NodeList getTreeForName(String name) throws Exception { 97 if (name == null) { 98 throw new IllegalArgumentException ("variable-name must not be null !"); 99 } 100 101 NodeList result = (NodeList ) variables.get(name); 102 if (result == null) { 103 throw new Exception ("no variable named " + name + " found !"); 104 } 105 106 return result; 107 } 108 109 110 113 public TempTree() { 114 variables = new Hashtable (); 115 } 116 } 117 118 | Popular Tags |