1 package net.sourceforge.pmd.lang.ast.xpath.saxon;
2
3 import net.sf.saxon.Configuration;
4 import net.sf.saxon.event.Receiver;
5 import net.sf.saxon.om.Axis;
6 import net.sf.saxon.om.AxisIterator;
7 import net.sf.saxon.om.DocumentInfo;
8 import net.sf.saxon.om.FastStringBuffer;
9 import net.sf.saxon.om.NamePool;
10 import net.sf.saxon.om.NodeInfo;
11 import net.sf.saxon.om.SequenceIterator;
12 import net.sf.saxon.om.SiblingCountingNode;
13 import net.sf.saxon.om.VirtualNode;
14 import net.sf.saxon.om.Navigator.AxisFilter;
15 import net.sf.saxon.pattern.NodeTest;
16 import net.sf.saxon.trans.XPathException;
17 import net.sf.saxon.value.Value;
18
19
20
21
22
23
24
25
26 public class AbstractNodeInfo implements VirtualNode, SiblingCountingNode {
27
28
29
30 public String getSystemId() {
31 throw createUnsupportedOperationException("Source.getSystemId()");
32 }
33
34
35
36
37 public void setSystemId(String systemId) {
38 throw createUnsupportedOperationException("Source.setSystemId(String)");
39 }
40
41
42
43
44 public String getStringValue() {
45 throw createUnsupportedOperationException("ValueRepresentation.getStringValue()");
46 }
47
48
49
50
51 public CharSequence getStringValueCS() {
52 throw createUnsupportedOperationException("ValueRepresentation.getStringValueCS()");
53 }
54
55
56
57
58 public SequenceIterator getTypedValue() throws XPathException {
59 throw createUnsupportedOperationException("Item.getTypedValue()");
60 }
61
62
63
64
65 public Object getUnderlyingNode() {
66 throw createUnsupportedOperationException("VirtualNode.getUnderlyingNode()");
67 }
68
69
70
71
72 public int getSiblingPosition() {
73 throw createUnsupportedOperationException("SiblingCountingNode.getSiblingPosition()");
74 }
75
76
77
78
79 public Value atomize() throws XPathException {
80 throw createUnsupportedOperationException("NodeInfo.atomize()");
81 }
82
83
84
85
86 public int compareOrder(NodeInfo other) {
87 throw createUnsupportedOperationException("NodeInfo.compareOrder(NodeInfo)");
88 }
89
90
91
92
93 public void copy(Receiver receiver, int whichNamespaces, boolean copyAnnotations, int locationId)
94 throws XPathException {
95 throw createUnsupportedOperationException("ValueRepresentation.copy(Receiver, int, boolean, int)");
96 }
97
98
99
100
101
102
103
104 @Override
105 public boolean equals(Object other) {
106 if (this == other) {
107 return true;
108 }
109 if (other instanceof ElementNode) {
110 return this.getUnderlyingNode() == ((ElementNode) other).getUnderlyingNode();
111 }
112 return false;
113 }
114
115
116
117
118 public void generateId(FastStringBuffer buffer) {
119 throw createUnsupportedOperationException("NodeInfo.generateId(FastStringBuffer)");
120 }
121
122
123
124
125 public String getAttributeValue(int fingerprint) {
126 throw createUnsupportedOperationException("NodeInfo.getAttributeValue(int)");
127 }
128
129
130
131
132 public String getBaseURI() {
133 throw createUnsupportedOperationException("NodeInfo.getBaseURI()");
134 }
135
136
137
138
139 public int getColumnNumber() {
140 throw createUnsupportedOperationException("NodeInfo.getColumnNumber()");
141 }
142
143
144
145
146 public Configuration getConfiguration() {
147 throw createUnsupportedOperationException("NodeInfo.getConfiguration()");
148 }
149
150
151
152
153 public int[] getDeclaredNamespaces(int[] buffer) {
154 throw createUnsupportedOperationException("NodeInfo.getDeclaredNamespaces(int[])");
155 }
156
157
158
159
160 public String getDisplayName() {
161 throw createUnsupportedOperationException("NodeInfo.getDisplayName()");
162 }
163
164
165
166
167
168
169 public int getDocumentNumber() {
170 return 0;
171 }
172
173
174
175
176 public DocumentInfo getDocumentRoot() {
177 throw createUnsupportedOperationException("NodeInfo.getDocumentRoot()");
178 }
179
180
181
182
183 public int getFingerprint() {
184 throw createUnsupportedOperationException("NodeInfo.getFingerprint()");
185 }
186
187
188
189
190 public int getLineNumber() {
191 throw createUnsupportedOperationException("NodeInfo.getLineNumber()");
192 }
193
194
195
196
197 public String getLocalPart() {
198 throw createUnsupportedOperationException("NodeInfo.getLocalPart()");
199 }
200
201
202
203
204 public int getNameCode() {
205 throw createUnsupportedOperationException("NodeInfo.getNameCode()");
206 }
207
208
209
210
211 public NamePool getNamePool() {
212 throw createUnsupportedOperationException("NodeInfo.getNamePool()");
213 }
214
215
216
217
218 public int getNodeKind() {
219 throw createUnsupportedOperationException("NodeInfo.getNodeKind()");
220 }
221
222
223
224
225 public NodeInfo getParent() {
226 throw createUnsupportedOperationException("NodeInfo.getParent()");
227 }
228
229
230
231
232 public String getPrefix() {
233 throw createUnsupportedOperationException("NodeInfo.getPrefix()");
234 }
235
236
237
238
239 public NodeInfo getRoot() {
240 throw createUnsupportedOperationException("NodeInfo.getRoot()");
241 }
242
243
244
245
246 public int getTypeAnnotation() {
247 throw createUnsupportedOperationException("NodeInfo.getTypeAnnotation()");
248 }
249
250
251
252
253 public String getURI() {
254 throw createUnsupportedOperationException("NodeInfo.getURI()");
255 }
256
257
258
259
260 public boolean hasChildNodes() {
261 throw createUnsupportedOperationException("NodeInfo.hasChildNodes()");
262 }
263
264
265
266
267 public boolean isId() {
268 throw createUnsupportedOperationException("NodeInfo.isId()");
269 }
270
271
272
273
274 public boolean isIdref() {
275 throw createUnsupportedOperationException("NodeInfo.isIdref()");
276 }
277
278
279
280
281 public boolean isNilled() {
282 throw createUnsupportedOperationException("NodeInfo.isNilled()");
283 }
284
285
286
287
288
289
290
291 public boolean isSameNodeInfo(NodeInfo other) {
292 return this.equals(other);
293 }
294
295
296
297
298 public AxisIterator iterateAxis(byte axisNumber) {
299 throw createUnsupportedOperationException("NodeInfo.iterateAxis(byte) for axis '" + Axis.axisName[axisNumber]
300 + "'");
301 }
302
303
304
305
306
307
308
309
310 public AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest) {
311 AxisIterator axisIterator = iterateAxis(axisNumber);
312 if (nodeTest != null) {
313 axisIterator = new AxisFilter(axisIterator, nodeTest);
314 }
315 return axisIterator;
316 }
317
318
319
320
321
322
323
324
325 protected UnsupportedOperationException createUnsupportedOperationException(String name) {
326 return new UnsupportedOperationException(name + " is not implemented by " + this.getClass().getName());
327 }
328 }