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