• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the  "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 /*
19  * $Id: XMLErrorResources.java 468653 2006-10-28 07:07:05Z minchau $
20  */
21 package org.apache.xml.res;
22 
23 
24 import java.util.ListResourceBundle;
25 
26 /**
27  * Set up error messages.
28  * We build a two dimensional array of message keys and
29  * message strings. In order to add a new message here,
30  * you need to first add a String constant. And you need
31  * to enter key, value pair as part of the contents
32  * array. You also need to update MAX_CODE for error strings
33  * and MAX_WARNING for warnings ( Needed for only information
34  * purpose )
35  */
36 public class XMLErrorResources extends ListResourceBundle
37 {
38 
39 /*
40  * This file contains error and warning messages related to Xalan Error
41  * Handling.
42  *
43  *  General notes to translators:
44  *
45  *  1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
46  *     components.
47  *     XSLT is an acronym for "XML Stylesheet Language: Transformations".
48  *     XSLTC is an acronym for XSLT Compiler.
49  *
50  *  2) A stylesheet is a description of how to transform an input XML document
51  *     into a resultant XML document (or HTML document or text).  The
52  *     stylesheet itself is described in the form of an XML document.
53  *
54  *  3) A template is a component of a stylesheet that is used to match a
55  *     particular portion of an input document and specifies the form of the
56  *     corresponding portion of the output document.
57  *
58  *  4) An element is a mark-up tag in an XML document; an attribute is a
59  *     modifier on the tag.  For example, in <elem attr='val' attr2='val2'>
60  *     "elem" is an element name, "attr" and "attr2" are attribute names with
61  *     the values "val" and "val2", respectively.
62  *
63  *  5) A namespace declaration is a special attribute that is used to associate
64  *     a prefix with a URI (the namespace).  The meanings of element names and
65  *     attribute names that use that prefix are defined with respect to that
66  *     namespace.
67  *
68  *  6) "Translet" is an invented term that describes the class file that
69  *     results from compiling an XML stylesheet into a Java class.
70  *
71  *  7) XPath is a specification that describes a notation for identifying
72  *     nodes in a tree-structured representation of an XML document.  An
73  *     instance of that notation is referred to as an XPath expression.
74  *
75  */
76 
77   /*
78    * Message keys
79    */
80   public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
81   public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
82   public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
83   public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
84   public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
85   public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
86   public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
87   public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
88   public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
89   public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
90   public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
91   public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
92   public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
93   public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
94   public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
95   public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
96   public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
97   public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
98   public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
99   public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
100   public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
101   public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
102   public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
103   public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
104   public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
105   public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
106   public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
107   public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
108   public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
109   public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
110   public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
111   public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
112   public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
113   public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
114   public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
115   public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
116   public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
117   public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
118   public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
119   public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
120   public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
121   public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
122   public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
123   public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
124   public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
125   public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
126   public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
127   public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
128   public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
129   public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
130   public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
131   public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
132   public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
133   public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
134   public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
135   public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
136   public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
137   public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
138   public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
139   public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
140   public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
141   public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
142 
143   /*
144    * Now fill in the message text.
145    * Then fill in the message text for that message code in the
146    * array. Use the new error code as the index into the array.
147    */
148 
149   // Error messages...
150 
151   /**
152    * Get the lookup table for error messages
153    *
154    * @return The association list.
155    */
getContents()156   public Object[][] getContents()
157   {
158     return new Object[][] {
159 
160   /** Error message ID that has a null message, but takes in a single object.    */
161     {"ER0000" , "{0}" },
162 
163     { ER_FUNCTION_NOT_SUPPORTED,
164       "Function not supported!"},
165 
166     { ER_CANNOT_OVERWRITE_CAUSE,
167       "Cannot overwrite cause"},
168 
169     { ER_NO_DEFAULT_IMPL,
170       "No default implementation found "},
171 
172     { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
173       "ChunkedIntArray({0}) not currently supported"},
174 
175     { ER_OFFSET_BIGGER_THAN_SLOT,
176       "Offset bigger than slot"},
177 
178     { ER_COROUTINE_NOT_AVAIL,
179       "Coroutine not available, id={0}"},
180 
181     { ER_COROUTINE_CO_EXIT,
182       "CoroutineManager received co_exit() request"},
183 
184     { ER_COJOINROUTINESET_FAILED,
185       "co_joinCoroutineSet() failed"},
186 
187     { ER_COROUTINE_PARAM,
188       "Coroutine parameter error ({0})"},
189 
190     { ER_PARSER_DOTERMINATE_ANSWERS,
191       "\nUNEXPECTED: Parser doTerminate answers {0}"},
192 
193     { ER_NO_PARSE_CALL_WHILE_PARSING,
194       "parse may not be called while parsing"},
195 
196     { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
197       "Error: typed iterator for axis  {0} not implemented"},
198 
199     { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
200       "Error: iterator for axis {0} not implemented "},
201 
202     { ER_ITERATOR_CLONE_NOT_SUPPORTED,
203       "Iterator clone not supported"},
204 
205     { ER_UNKNOWN_AXIS_TYPE,
206       "Unknown axis traversal type: {0}"},
207 
208     { ER_AXIS_NOT_SUPPORTED,
209       "Axis traverser not supported: {0}"},
210 
211     { ER_NO_DTMIDS_AVAIL,
212       "No more DTM IDs are available"},
213 
214     { ER_NOT_SUPPORTED,
215       "Not supported: {0}"},
216 
217     { ER_NODE_NON_NULL,
218       "Node must be non-null for getDTMHandleFromNode"},
219 
220     { ER_COULD_NOT_RESOLVE_NODE,
221       "Could not resolve the node to a handle"},
222 
223     { ER_STARTPARSE_WHILE_PARSING,
224        "startParse may not be called while parsing"},
225 
226     { ER_STARTPARSE_NEEDS_SAXPARSER,
227        "startParse needs a non-null SAXParser"},
228 
229     { ER_COULD_NOT_INIT_PARSER,
230        "could not initialize parser with"},
231 
232     { ER_EXCEPTION_CREATING_POOL,
233        "exception creating new instance for pool"},
234 
235     { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
236        "Path contains invalid escape sequence"},
237 
238     { ER_SCHEME_REQUIRED,
239        "Scheme is required!"},
240 
241     { ER_NO_SCHEME_IN_URI,
242        "No scheme found in URI: {0}"},
243 
244     { ER_NO_SCHEME_INURI,
245        "No scheme found in URI"},
246 
247     { ER_PATH_INVALID_CHAR,
248        "Path contains invalid character: {0}"},
249 
250     { ER_SCHEME_FROM_NULL_STRING,
251        "Cannot set scheme from null string"},
252 
253     { ER_SCHEME_NOT_CONFORMANT,
254        "The scheme is not conformant."},
255 
256     { ER_HOST_ADDRESS_NOT_WELLFORMED,
257        "Host is not a well formed address"},
258 
259     { ER_PORT_WHEN_HOST_NULL,
260        "Port cannot be set when host is null"},
261 
262     { ER_INVALID_PORT,
263        "Invalid port number"},
264 
265     { ER_FRAG_FOR_GENERIC_URI,
266        "Fragment can only be set for a generic URI"},
267 
268     { ER_FRAG_WHEN_PATH_NULL,
269        "Fragment cannot be set when path is null"},
270 
271     { ER_FRAG_INVALID_CHAR,
272        "Fragment contains invalid character"},
273 
274     { ER_PARSER_IN_USE,
275       "Parser is already in use"},
276 
277     { ER_CANNOT_CHANGE_WHILE_PARSING,
278       "Cannot change {0} {1} while parsing"},
279 
280     { ER_SELF_CAUSATION_NOT_PERMITTED,
281       "Self-causation not permitted"},
282 
283     { ER_NO_USERINFO_IF_NO_HOST,
284       "Userinfo may not be specified if host is not specified"},
285 
286     { ER_NO_PORT_IF_NO_HOST,
287       "Port may not be specified if host is not specified"},
288 
289     { ER_NO_QUERY_STRING_IN_PATH,
290       "Query string cannot be specified in path and query string"},
291 
292     { ER_NO_FRAGMENT_STRING_IN_PATH,
293       "Fragment cannot be specified in both the path and fragment"},
294 
295     { ER_CANNOT_INIT_URI_EMPTY_PARMS,
296       "Cannot initialize URI with empty parameters"},
297 
298     { ER_METHOD_NOT_SUPPORTED,
299       "Method not yet supported "},
300 
301     { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
302       "IncrementalSAXSource_Filter not currently restartable"},
303 
304     { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
305       "XMLReader not before startParse request"},
306 
307     { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
308       "Axis traverser not supported: {0}"},
309 
310     { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
311       "ListingErrorHandler created with null PrintWriter!"},
312 
313     { ER_SYSTEMID_UNKNOWN,
314       "SystemId Unknown"},
315 
316     { ER_LOCATION_UNKNOWN,
317       "Location of error unknown"},
318 
319     { ER_PREFIX_MUST_RESOLVE,
320       "Prefix must resolve to a namespace: {0}"},
321 
322     { ER_CREATEDOCUMENT_NOT_SUPPORTED,
323       "createDocument() not supported in XPathContext!"},
324 
325     { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
326       "Attribute child does not have an owner document!"},
327 
328     { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
329       "Attribute child does not have an owner document element!"},
330 
331     { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
332       "Warning: can't output text before document element!  Ignoring..."},
333 
334     { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
335       "Can't have more than one root on a DOM!"},
336 
337     { ER_ARG_LOCALNAME_NULL,
338        "Argument 'localName' is null"},
339 
340     // Note to translators:  A QNAME has the syntactic form [NCName:]NCName
341     // The localname is the portion after the optional colon; the message indicates
342     // that there is a problem with that part of the QNAME.
343     { ER_ARG_LOCALNAME_INVALID,
344        "Localname in QNAME should be a valid NCName"},
345 
346     // Note to translators:  A QNAME has the syntactic form [NCName:]NCName
347     // The prefix is the portion before the optional colon; the message indicates
348     // that there is a problem with that part of the QNAME.
349     { ER_ARG_PREFIX_INVALID,
350        "Prefix in QNAME should be a valid NCName"},
351 
352     { ER_NAME_CANT_START_WITH_COLON,
353       "Name cannot start with a colon"},
354 
355     { "BAD_CODE", "Parameter to createMessage was out of bounds"},
356     { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
357     { "line", "Line #"},
358     { "column","Column #"}
359 
360 
361   };
362   }
363 }
364