1 package net.sf.saxon.instruct; 2 3 import net.sf.saxon.expr.Expression; 4 import net.sf.saxon.om.NamespaceResolver; 5 import net.sf.saxon.trace.InstructionInfo; 6 7 import java.util.HashMap ; 8 import java.util.Iterator ; 9 10 15 16 20 public class TraceExpression extends TraceWrapper implements InstructionInfo { 21 22 private int lineNumber = -1; 23 private int columnNumber = -1; 24 private String systemId = null; 25 private int objectNameCode = -1; 26 private int constructType; 27 private NamespaceResolver namespaceResolver = null; 28 private HashMap properties = new HashMap (10); 29 30 35 public TraceExpression(Expression child) { 36 this.child = child; 37 setProperty("expression", child); 38 } 39 40 44 public void setLineNumber(int line) { 45 lineNumber = line; 46 } 47 48 52 public void setColumnNumber(int column) { 53 columnNumber = column; 54 } 55 56 60 61 public void setConstructType(int type) { 62 constructType = type; 63 } 64 65 69 public int getConstructType() { 70 return constructType; 71 } 72 73 77 78 public void setNamespaceResolver(NamespaceResolver resolver) { 79 namespaceResolver = resolver; 80 } 81 82 86 87 public NamespaceResolver getNamespaceResolver() { 88 return namespaceResolver; 89 } 90 91 95 96 public void setSystemId(String systemId) { 97 this.systemId = systemId; 98 } 99 100 104 105 public String getSystemId() { 106 return systemId; 107 } 108 109 113 114 public int getLineNumber() { 115 return lineNumber; 116 } 117 118 122 123 public void setObjectNameCode(int nameCode) { 124 objectNameCode = nameCode; 125 } 126 127 131 132 public int getObjectNameCode() { 133 return objectNameCode; 134 } 135 136 139 140 public void setProperty(String name, Object value) { 141 properties.put(name, value); 142 } 143 144 147 148 public Object getProperty(String name) { 149 return properties.get(name); 150 } 151 152 157 158 public Iterator getProperties() { 159 return properties.keySet().iterator(); 160 } 161 162 163 169 170 public int getColumnNumber() { 171 return columnNumber; 172 } 173 174 178 179 public InstructionInfo getInstructionInfo() { 180 return this; 181 } 182 183 190 public String getSystemId(int locationId) { 191 return getSystemId(); 192 } 193 200 201 public int getLineNumber(int locationId) { 202 return getLineNumber(); 203 } 204 } 205 206 224 | Popular Tags |