1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 package org.treetank.service.xml.xpath;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 public class XPathError extends RuntimeException {
54
55
56 private static final long serialVersionUID = 1L;
57
58
59
60
61
62
63
64 public XPathError(final ErrorType mErr) {
65
66 super(mErr.getMsg());
67 }
68
69
70
71
72 @Override
73 public Throwable fillInStackTrace() {
74
75
76
77
78
79
80
81 return this;
82 }
83
84
85
86
87
88
89
90 public enum ErrorType {
91
92
93 XPST0001("err:XPST0001: Some component of the static context has not "
94 + "been assigned a value."),
95
96
97 XPDY0002("err:XPDY0002: Some part of the dynamic context has not " + "been assigned a value."),
98
99
100 XPST0003("err:XPST0003: Expression is not a valid instance of the grammar"
101 + "defined in A.1 EBNF."),
102
103
104 XPTY0004("err:XPTY0004 The type is not appropriate the expression or the "
105 + "typedoes not match a required type as specified by the matching rules."),
106
107
108 XPST0005("err:XPST0005: The static type assigned to an expression other than the "
109 + "expression() or data(()) is empty-sequence()."),
110
111
112 XPST0008("err:XPST0008 Expression refers to a name that is not defined in the "
113 + "static context"),
114
115
116 XPST0010("err:XPST0010: " + "Axis is not supported."),
117
118
119 XPST0017("err:XPST0017 The expanded QName and number of arguments in a "
120 + "function call do not match the name and arity of a function " + "signature."),
121
122
123 XPTY0018("err:XPTY0018 Result of the last step "
124 + "in a path expression contains both nodes and atomic values."),
125
126
127 XPTY0019("err:XPTY0019 Result of a step (other "
128 + "than the last step) in a path expression contains an atomic value."),
129
130
131 XPTY0020("err:XPTY0020 Context item in an axis step is not a node."),
132
133
134 XPDY0050("err:XPDY0050 " + "Dynamic type of the operand of a treat expression does not match"
135 + " the sequence type specified by the treat expression."),
136
137
138 XPST0051("err:XPST0051 " + "Type is not defined in the in-scope schema types as an "
139 + "atomic type."),
140
141
142 XPST0080("err:XPST0080 " + "Target type of a cast or castable expression must not be "
143 + "xs:NOTATION or xs:anyAtomicType."),
144
145
146 XPST0081("err:XPST0081 " + "Namespace prefix cannot be expanded into a namespace URI by "
147 + "using the statically known namespaces."),
148
149 FOCA0001("err:FOCA0001, Input value too large for decimal."),
150 FOCA0002("err:FOCA0002, Invalid lexical value."),
151 FOCA0003("err:FOCA0003, Input value too large for integer."),
152 FOCA0005("err:FOCA0005, NaN supplied as float/double value."),
153 FOCA0006("err:FOCA0006, String to be cast to decimal has too many digits of precision."),
154 FOCH0001("err:FOCH0001, Code point not valid."),
155 FOCH0002("err:FOCH0002, Unsupported collation."),
156 FOCH0003("err:FOCH0003, Unsupported normalization form."),
157 FORH0004("err:FOCH0004, Collation does not support collation units."),
158 FODC0001("err:FODC0001, No context document."),
159 FODC0002("err:FODC0002, Error retrieving resource."),
160 FODC0003("err:FODC0003, Function stability not defined."),
161 FODC0004("err:FODC0004, Invalid argument to fn:collection."),
162 FODC0005("err:FODC0005, Invalid argument to fn:doc or fn:doc-available."),
163 FODT0001("err:FODT0001, Overflow/underflow in date/time operation."),
164 FODT0002("err:FODT0002, Overflow/underflow in duration operation."),
165 FODT0003("err:FODT0003, Invalid timezone value."),
166 FONS0004("err:FONS0004, No namespace found for prefix."),
167 FONS0005("err:FONS0005, Base-uri not defined in the static context."),
168
169
170
171
172 FOAR0001("err:FOAR0001: Division by zero."),
173
174
175
176
177
178 FOAR0002("err:FOAR0002: Numeric operation overflow/underflow."),
179 FOER0000("err:FOER0000: Unidentified error."),
180 FORG0001("err:FORG0001, Invalid value for cast/constructor."),
181 FORG0002("err:FORG0002, Invalid argument to fn:resolve-uri()."),
182 FORG0003("err:FORG0003, fn:zero-or-one called with a sequence containing more than one item."),
183 FORG0004("err:FORG0004, fn:one-or-more called with a sequence containing no items."),
184 FORG0005(
185 "err:FORG0005, fn:exactly-one called with a sequence containing zero or more than one item."),
186
187 FORG0006("err:FORG0006 Invalid argument type."), FORG0007(""), FORG0008(
188 "err:FORG0008, Both arguments to fn:dateTime have a specified timezone."), FORG0009(
189 "err:FORG0009, Error in resolving a relative URI against a base URI in fn:resolve-uri."),
190 FORX0001("err:FORX0001, Invalid regular expression. flags"), FORX0002(
191 "err:FORX0002, Invalid regular expression."), FORX0003(
192 "err:FORX0003, Regular expression matches zero-length string."), FORX0004(
193 "err:FORX0004, Invalid replacement string."), FOTY0012(
194 "err:FOTY0012, Argument node does not have a typed value."), ;
195
196
197 private String message;
198
199
200
201
202
203
204
205 private ErrorType(final String msg) {
206
207 message = msg;
208 }
209
210
211
212
213
214
215 public String getMsg() {
216
217 return message;
218 }
219
220 }
221
222 }