Source Home >> Java Source 1.6.0 >> com.sun.org.apache.xml.internal.res.XMLErrorResources V 0.09
  • 001/*
  • 002 * Copyright 1999-2004 The Apache Software Foundation.
  • 003 *
  • 004 * Licensed under the Apache License, Version 2.0 (the "License");
  • 005 * you may not use this file except in compliance with the License.
  • 006 * You may obtain a copy of the License at
  • 007 *
  • 008 * http://www.apache.org/licenses/LICENSE-2.0
  • 009 *
  • 010 * Unless required by applicable law or agreed to in writing, software
  • 011 * distributed under the License is distributed on an "AS IS" BASIS,
  • 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  • 013 * See the License for the specific language governing permissions and
  • 014 * limitations under the License.
  • 015 */
  • 016/*
  • 017 * $Id: XMLErrorResources.java,v 1.2.4.1 2005/09/15 07:45:37 suresh_emailid Exp $
  • 018 */
  • 019package com.sun.org.apache.xml.internal.res;
  • 020
  • 021
  • 022import java.util.ListResourceBundle;
  • 023import java.util.Locale;
  • 024import java.util.MissingResourceException;
  • 025import java.util.ResourceBundle;
  • 026
  • 027/**
  • 028 * Set up error messages.
  • 029 * We build a two dimensional array of message keys and
  • 030 * message strings. In order to add a new message here,
  • 031 * you need to first add a String constant. And you need
  • 032 * to enter key, value pair as part of the contents
  • 033 * array. You also need to update MAX_CODE for error strings
  • 034 * and MAX_WARNING for warnings ( Needed for only information
  • 035 * purpose )
  • 036 */
  • 037public class XMLErrorResources extends ListResourceBundle
  • 038{
  • 039
  • 040/*
  • 041 * This file contains error and warning messages related to Xalan Error
  • 042 * Handling.
  • 043 *
  • 044 * General notes to translators:
  • 045 *
  • 046 * 1) Xalan (or more properly, Xalan-interpretive) and XSLTC are names of
  • 047 * components.
  • 048 * XSLT is an acronym for "XML Stylesheet Language: Transformations".
  • 049 * XSLTC is an acronym for XSLT Compiler.
  • 050 *
  • 051 * 2) A stylesheet is a description of how to transform an input XML document
  • 052 * into a resultant XML document (or HTML document or text). The
  • 053 * stylesheet itself is described in the form of an XML document.
  • 054 *
  • 055 * 3) A template is a component of a stylesheet that is used to match a
  • 056 * particular portion of an input document and specifies the form of the
  • 057 * corresponding portion of the output document.
  • 058 *
  • 059 * 4) An element is a mark-up tag in an XML document; an attribute is a
  • 060 * modifier on the tag. For example, in <elem attr='val' attr2='val2'>
  • 061 * "elem" is an element name, "attr" and "attr2" are attribute names with
  • 062 * the values "val" and "val2", respectively.
  • 063 *
  • 064 * 5) A namespace declaration is a special attribute that is used to associate
  • 065 * a prefix with a URI (the namespace). The meanings of element names and
  • 066 * attribute names that use that prefix are defined with respect to that
  • 067 * namespace.
  • 068 *
  • 069 * 6) "Translet" is an invented term that describes the class file that
  • 070 * results from compiling an XML stylesheet into a Java class.
  • 071 *
  • 072 * 7) XPath is a specification that describes a notation for identifying
  • 073 * nodes in a tree-structured representation of an XML document. An
  • 074 * instance of that notation is referred to as an XPath expression.
  • 075 *
  • 076 */
  • 077
  • 078 /** Maximum error messages, this is needed to keep track of the number of messages. */
  • 079 public static final int MAX_CODE = 61;
  • 080
  • 081 /** Maximum warnings, this is needed to keep track of the number of warnings. */
  • 082 public static final int MAX_WARNING = 0;
  • 083
  • 084 /** Maximum misc strings. */
  • 085 public static final int MAX_OTHERS = 4;
  • 086
  • 087 /** Maximum total warnings and error messages. */
  • 088 public static final int MAX_MESSAGES = MAX_CODE + MAX_WARNING + 1;
  • 089
  • 090
  • 091 /*
  • 092 * Message keys
  • 093 */
  • 094 public static final String ER_FUNCTION_NOT_SUPPORTED = "ER_FUNCTION_NOT_SUPPORTED";
  • 095 public static final String ER_CANNOT_OVERWRITE_CAUSE = "ER_CANNOT_OVERWRITE_CAUSE";
  • 096 public static final String ER_NO_DEFAULT_IMPL = "ER_NO_DEFAULT_IMPL";
  • 097 public static final String ER_CHUNKEDINTARRAY_NOT_SUPPORTED = "ER_CHUNKEDINTARRAY_NOT_SUPPORTED";
  • 098 public static final String ER_OFFSET_BIGGER_THAN_SLOT = "ER_OFFSET_BIGGER_THAN_SLOT";
  • 099 public static final String ER_COROUTINE_NOT_AVAIL = "ER_COROUTINE_NOT_AVAIL";
  • 100 public static final String ER_COROUTINE_CO_EXIT = "ER_COROUTINE_CO_EXIT";
  • 101 public static final String ER_COJOINROUTINESET_FAILED = "ER_COJOINROUTINESET_FAILED";
  • 102 public static final String ER_COROUTINE_PARAM = "ER_COROUTINE_PARAM";
  • 103 public static final String ER_PARSER_DOTERMINATE_ANSWERS = "ER_PARSER_DOTERMINATE_ANSWERS";
  • 104 public static final String ER_NO_PARSE_CALL_WHILE_PARSING = "ER_NO_PARSE_CALL_WHILE_PARSING";
  • 105 public static final String ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED";
  • 106 public static final String ER_ITERATOR_AXIS_NOT_IMPLEMENTED = "ER_ITERATOR_AXIS_NOT_IMPLEMENTED";
  • 107 public static final String ER_ITERATOR_CLONE_NOT_SUPPORTED = "ER_ITERATOR_CLONE_NOT_SUPPORTED";
  • 108 public static final String ER_UNKNOWN_AXIS_TYPE = "ER_UNKNOWN_AXIS_TYPE";
  • 109 public static final String ER_AXIS_NOT_SUPPORTED = "ER_AXIS_NOT_SUPPORTED";
  • 110 public static final String ER_NO_DTMIDS_AVAIL = "ER_NO_DTMIDS_AVAIL";
  • 111 public static final String ER_NOT_SUPPORTED = "ER_NOT_SUPPORTED";
  • 112 public static final String ER_NODE_NON_NULL = "ER_NODE_NON_NULL";
  • 113 public static final String ER_COULD_NOT_RESOLVE_NODE = "ER_COULD_NOT_RESOLVE_NODE";
  • 114 public static final String ER_STARTPARSE_WHILE_PARSING = "ER_STARTPARSE_WHILE_PARSING";
  • 115 public static final String ER_STARTPARSE_NEEDS_SAXPARSER = "ER_STARTPARSE_NEEDS_SAXPARSER";
  • 116 public static final String ER_COULD_NOT_INIT_PARSER = "ER_COULD_NOT_INIT_PARSER";
  • 117 public static final String ER_EXCEPTION_CREATING_POOL = "ER_EXCEPTION_CREATING_POOL";
  • 118 public static final String ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE = "ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE";
  • 119 public static final String ER_SCHEME_REQUIRED = "ER_SCHEME_REQUIRED";
  • 120 public static final String ER_NO_SCHEME_IN_URI = "ER_NO_SCHEME_IN_URI";
  • 121 public static final String ER_NO_SCHEME_INURI = "ER_NO_SCHEME_INURI";
  • 122 public static final String ER_PATH_INVALID_CHAR = "ER_PATH_INVALID_CHAR";
  • 123 public static final String ER_SCHEME_FROM_NULL_STRING = "ER_SCHEME_FROM_NULL_STRING";
  • 124 public static final String ER_SCHEME_NOT_CONFORMANT = "ER_SCHEME_NOT_CONFORMANT";
  • 125 public static final String ER_HOST_ADDRESS_NOT_WELLFORMED = "ER_HOST_ADDRESS_NOT_WELLFORMED";
  • 126 public static final String ER_PORT_WHEN_HOST_NULL = "ER_PORT_WHEN_HOST_NULL";
  • 127 public static final String ER_INVALID_PORT = "ER_INVALID_PORT";
  • 128 public static final String ER_FRAG_FOR_GENERIC_URI ="ER_FRAG_FOR_GENERIC_URI";
  • 129 public static final String ER_FRAG_WHEN_PATH_NULL = "ER_FRAG_WHEN_PATH_NULL";
  • 130 public static final String ER_FRAG_INVALID_CHAR = "ER_FRAG_INVALID_CHAR";
  • 131 public static final String ER_PARSER_IN_USE = "ER_PARSER_IN_USE";
  • 132 public static final String ER_CANNOT_CHANGE_WHILE_PARSING = "ER_CANNOT_CHANGE_WHILE_PARSING";
  • 133 public static final String ER_SELF_CAUSATION_NOT_PERMITTED = "ER_SELF_CAUSATION_NOT_PERMITTED";
  • 134 public static final String ER_NO_USERINFO_IF_NO_HOST = "ER_NO_USERINFO_IF_NO_HOST";
  • 135 public static final String ER_NO_PORT_IF_NO_HOST = "ER_NO_PORT_IF_NO_HOST";
  • 136 public static final String ER_NO_QUERY_STRING_IN_PATH = "ER_NO_QUERY_STRING_IN_PATH";
  • 137 public static final String ER_NO_FRAGMENT_STRING_IN_PATH = "ER_NO_FRAGMENT_STRING_IN_PATH";
  • 138 public static final String ER_CANNOT_INIT_URI_EMPTY_PARMS = "ER_CANNOT_INIT_URI_EMPTY_PARMS";
  • 139 public static final String ER_METHOD_NOT_SUPPORTED ="ER_METHOD_NOT_SUPPORTED";
  • 140 public static final String ER_INCRSAXSRCFILTER_NOT_RESTARTABLE = "ER_INCRSAXSRCFILTER_NOT_RESTARTABLE";
  • 141 public static final String ER_XMLRDR_NOT_BEFORE_STARTPARSE = "ER_XMLRDR_NOT_BEFORE_STARTPARSE";
  • 142 public static final String ER_AXIS_TRAVERSER_NOT_SUPPORTED = "ER_AXIS_TRAVERSER_NOT_SUPPORTED";
  • 143 public static final String ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER = "ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER";
  • 144 public static final String ER_SYSTEMID_UNKNOWN = "ER_SYSTEMID_UNKNOWN";
  • 145 public static final String ER_LOCATION_UNKNOWN = "ER_LOCATION_UNKNOWN";
  • 146 public static final String ER_PREFIX_MUST_RESOLVE = "ER_PREFIX_MUST_RESOLVE";
  • 147 public static final String ER_CREATEDOCUMENT_NOT_SUPPORTED = "ER_CREATEDOCUMENT_NOT_SUPPORTED";
  • 148 public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT";
  • 149 public static final String ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT = "ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT";
  • 150 public static final String ER_CANT_OUTPUT_TEXT_BEFORE_DOC = "ER_CANT_OUTPUT_TEXT_BEFORE_DOC";
  • 151 public static final String ER_CANT_HAVE_MORE_THAN_ONE_ROOT = "ER_CANT_HAVE_MORE_THAN_ONE_ROOT";
  • 152 public static final String ER_ARG_LOCALNAME_NULL = "ER_ARG_LOCALNAME_NULL";
  • 153 public static final String ER_ARG_LOCALNAME_INVALID = "ER_ARG_LOCALNAME_INVALID";
  • 154 public static final String ER_ARG_PREFIX_INVALID = "ER_ARG_PREFIX_INVALID";
  • 155 public static final String ER_NAME_CANT_START_WITH_COLON = "ER_NAME_CANT_START_WITH_COLON";
  • 156
  • 157 // Message keys used by the serializer
  • 158 public static final String ER_RESOURCE_COULD_NOT_FIND = "ER_RESOURCE_COULD_NOT_FIND";
  • 159 public static final String ER_RESOURCE_COULD_NOT_LOAD = "ER_RESOURCE_COULD_NOT_LOAD";
  • 160 public static final String ER_BUFFER_SIZE_LESSTHAN_ZERO = "ER_BUFFER_SIZE_LESSTHAN_ZERO";
  • 161 public static final String ER_INVALID_UTF16_SURROGATE = "ER_INVALID_UTF16_SURROGATE";
  • 162 public static final String ER_OIERROR = "ER_OIERROR";
  • 163 public static final String ER_NAMESPACE_PREFIX = "ER_NAMESPACE_PREFIX";
  • 164 public static final String ER_STRAY_ATTRIBUTE = "ER_STRAY_ATTIRBUTE";
  • 165 public static final String ER_STRAY_NAMESPACE = "ER_STRAY_NAMESPACE";
  • 166 public static final String ER_COULD_NOT_LOAD_RESOURCE = "ER_COULD_NOT_LOAD_RESOURCE";
  • 167 public static final String ER_COULD_NOT_LOAD_METHOD_PROPERTY = "ER_COULD_NOT_LOAD_METHOD_PROPERTY";
  • 168 public static final String ER_SERIALIZER_NOT_CONTENTHANDLER = "ER_SERIALIZER_NOT_CONTENTHANDLER";
  • 169 public static final String ER_ILLEGAL_ATTRIBUTE_POSITION = "ER_ILLEGAL_ATTRIBUTE_POSITION";
  • 170 public static final String ER_ILLEGAL_CHARACTER = "ER_ILLEGAL_CHARACTER";
  • 171
  • 172 /*
  • 173 * Now fill in the message text.
  • 174 * Then fill in the message text for that message code in the
  • 175 * array. Use the new error code as the index into the array.
  • 176 */
  • 177
  • 178 // Error messages...
  • 179
  • 180 /** The lookup table for error messages. */
  • 181 public static final Object[][] contents = {
  • 182
  • 183 /** Error message ID that has a null message, but takes in a single object. */
  • 184 {"ER0000" , "{0}" },
  • 185
  • 186 { ER_FUNCTION_NOT_SUPPORTED,
  • 187 "Function not supported!"},
  • 188
  • 189 { ER_CANNOT_OVERWRITE_CAUSE,
  • 190 "Cannot overwrite cause"},
  • 191
  • 192 { ER_NO_DEFAULT_IMPL,
  • 193 "No default implementation found "},
  • 194
  • 195 { ER_CHUNKEDINTARRAY_NOT_SUPPORTED,
  • 196 "ChunkedIntArray({0}) not currently supported"},
  • 197
  • 198 { ER_OFFSET_BIGGER_THAN_SLOT,
  • 199 "Offset bigger than slot"},
  • 200
  • 201 { ER_COROUTINE_NOT_AVAIL,
  • 202 "Coroutine not available, id={0}"},
  • 203
  • 204 { ER_COROUTINE_CO_EXIT,
  • 205 "CoroutineManager received co_exit() request"},
  • 206
  • 207 { ER_COJOINROUTINESET_FAILED,
  • 208 "co_joinCoroutineSet() failed"},
  • 209
  • 210 { ER_COROUTINE_PARAM,
  • 211 "Coroutine parameter error ({0})"},
  • 212
  • 213 { ER_PARSER_DOTERMINATE_ANSWERS,
  • 214 "\nUNEXPECTED: Parser doTerminate answers {0}"},
  • 215
  • 216 { ER_NO_PARSE_CALL_WHILE_PARSING,
  • 217 "parse may not be called while parsing"},
  • 218
  • 219 { ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
  • 220 "Error: typed iterator for axis {0} not implemented"},
  • 221
  • 222 { ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
  • 223 "Error: iterator for axis {0} not implemented "},
  • 224
  • 225 { ER_ITERATOR_CLONE_NOT_SUPPORTED,
  • 226 "Iterator clone not supported"},
  • 227
  • 228 { ER_UNKNOWN_AXIS_TYPE,
  • 229 "Unknown axis traversal type: {0}"},
  • 230
  • 231 { ER_AXIS_NOT_SUPPORTED,
  • 232 "Axis traverser not supported: {0}"},
  • 233
  • 234 { ER_NO_DTMIDS_AVAIL,
  • 235 "No more DTM IDs are available"},
  • 236
  • 237 { ER_NOT_SUPPORTED,
  • 238 "Not supported: {0}"},
  • 239
  • 240 { ER_NODE_NON_NULL,
  • 241 "Node must be non-null for getDTMHandleFromNode"},
  • 242
  • 243 { ER_COULD_NOT_RESOLVE_NODE,
  • 244 "Could not resolve the node to a handle"},
  • 245
  • 246 { ER_STARTPARSE_WHILE_PARSING,
  • 247 "startParse may not be called while parsing"},
  • 248
  • 249 { ER_STARTPARSE_NEEDS_SAXPARSER,
  • 250 "startParse needs a non-null SAXParser"},
  • 251
  • 252 { ER_COULD_NOT_INIT_PARSER,
  • 253 "could not initialize parser with"},
  • 254
  • 255 { ER_EXCEPTION_CREATING_POOL,
  • 256 "exception creating new instance for pool"},
  • 257
  • 258 { ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
  • 259 "Path contains invalid escape sequence"},
  • 260
  • 261 { ER_SCHEME_REQUIRED,
  • 262 "Scheme is required!"},
  • 263
  • 264 { ER_NO_SCHEME_IN_URI,
  • 265 "No scheme found in URI: {0}"},
  • 266
  • 267 { ER_NO_SCHEME_INURI,
  • 268 "No scheme found in URI"},
  • 269
  • 270 { ER_PATH_INVALID_CHAR,
  • 271 "Path contains invalid character: {0}"},
  • 272
  • 273 { ER_SCHEME_FROM_NULL_STRING,
  • 274 "Cannot set scheme from null string"},
  • 275
  • 276 { ER_SCHEME_NOT_CONFORMANT,
  • 277 "The scheme is not conformant."},
  • 278
  • 279 { ER_HOST_ADDRESS_NOT_WELLFORMED,
  • 280 "Host is not a well formed address"},
  • 281
  • 282 { ER_PORT_WHEN_HOST_NULL,
  • 283 "Port cannot be set when host is null"},
  • 284
  • 285 { ER_INVALID_PORT,
  • 286 "Invalid port number"},
  • 287
  • 288 { ER_FRAG_FOR_GENERIC_URI,
  • 289 "Fragment can only be set for a generic URI"},
  • 290
  • 291 { ER_FRAG_WHEN_PATH_NULL,
  • 292 "Fragment cannot be set when path is null"},
  • 293
  • 294 { ER_FRAG_INVALID_CHAR,
  • 295 "Fragment contains invalid character"},
  • 296
  • 297 { ER_PARSER_IN_USE,
  • 298 "Parser is already in use"},
  • 299
  • 300 { ER_CANNOT_CHANGE_WHILE_PARSING,
  • 301 "Cannot change {0} {1} while parsing"},
  • 302
  • 303 { ER_SELF_CAUSATION_NOT_PERMITTED,
  • 304 "Self-causation not permitted"},
  • 305
  • 306 { ER_NO_USERINFO_IF_NO_HOST,
  • 307 "Userinfo may not be specified if host is not specified"},
  • 308
  • 309 { ER_NO_PORT_IF_NO_HOST,
  • 310 "Port may not be specified if host is not specified"},
  • 311
  • 312 { ER_NO_QUERY_STRING_IN_PATH,
  • 313 "Query string cannot be specified in path and query string"},
  • 314
  • 315 { ER_NO_FRAGMENT_STRING_IN_PATH,
  • 316 "Fragment cannot be specified in both the path and fragment"},
  • 317
  • 318 { ER_CANNOT_INIT_URI_EMPTY_PARMS,
  • 319 "Cannot initialize URI with empty parameters"},
  • 320
  • 321 { ER_METHOD_NOT_SUPPORTED,
  • 322 "Method not yet supported "},
  • 323
  • 324 { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,
  • 325 "IncrementalSAXSource_Filter not currently restartable"},
  • 326
  • 327 { ER_XMLRDR_NOT_BEFORE_STARTPARSE,
  • 328 "XMLReader not before startParse request"},
  • 329
  • 330 { ER_AXIS_TRAVERSER_NOT_SUPPORTED,
  • 331 "Axis traverser not supported: {0}"},
  • 332
  • 333 { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,
  • 334 "ListingErrorHandler created with null PrintWriter!"},
  • 335
  • 336 { ER_SYSTEMID_UNKNOWN,
  • 337 "SystemId Unknown"},
  • 338
  • 339 { ER_LOCATION_UNKNOWN,
  • 340 "Location of error unknown"},
  • 341
  • 342 { ER_PREFIX_MUST_RESOLVE,
  • 343 "Prefix must resolve to a namespace: {0}"},
  • 344
  • 345 { ER_CREATEDOCUMENT_NOT_SUPPORTED,
  • 346 "createDocument() not supported in XPathContext!"},
  • 347
  • 348 { ER_CHILD_HAS_NO_OWNER_DOCUMENT,
  • 349 "Attribute child does not have an owner document!"},
  • 350
  • 351 { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,
  • 352 "Attribute child does not have an owner document element!"},
  • 353
  • 354 { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,
  • 355 "Warning: can't output text before document element! Ignoring..."},
  • 356
  • 357 { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,
  • 358 "Can't have more than one root on a DOM!"},
  • 359
  • 360 { ER_ARG_LOCALNAME_NULL,
  • 361 "Argument 'localName' is null"},
  • 362
  • 363 // Note to translators: A QNAME has the syntactic form [NCName:]NCName
  • 364 // The localname is the portion after the optional colon; the message indicates
  • 365 // that there is a problem with that part of the QNAME.
  • 366 { ER_ARG_LOCALNAME_INVALID,
  • 367 "Localname in QNAME should be a valid NCName"},
  • 368
  • 369 // Note to translators: A QNAME has the syntactic form [NCName:]NCName
  • 370 // The prefix is the portion before the optional colon; the message indicates
  • 371 // that there is a problem with that part of the QNAME.
  • 372 { ER_ARG_PREFIX_INVALID,
  • 373 "Prefix in QNAME should be a valid NCName"},
  • 374
  • 375 { ER_NAME_CANT_START_WITH_COLON,
  • 376 "Name cannot start with a colon"},
  • 377
  • 378 { "BAD_CODE", "Parameter to createMessage was out of bounds"},
  • 379 { "FORMAT_FAILED", "Exception thrown during messageFormat call"},
  • 380 { "line", "Line #"},
  • 381 { "column","Column #"},
  • 382
  • 383 {ER_SERIALIZER_NOT_CONTENTHANDLER,
  • 384 "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler."},
  • 385
  • 386 {ER_RESOURCE_COULD_NOT_FIND,
  • 387 "The resource [ {0} ] could not be found.\n {1}" },
  • 388
  • 389 {ER_RESOURCE_COULD_NOT_LOAD,
  • 390 "The resource [ {0} ] could not load: {1} \n {2} \t {3}" },
  • 391
  • 392 {ER_BUFFER_SIZE_LESSTHAN_ZERO,
  • 393 "Buffer size <=0" },
  • 394
  • 395 {ER_INVALID_UTF16_SURROGATE,
  • 396 "Invalid UTF-16 surrogate detected: {0} ?" },
  • 397
  • 398 {ER_OIERROR,
  • 399 "IO error" },
  • 400
  • 401 {ER_ILLEGAL_ATTRIBUTE_POSITION,
  • 402 "Cannot add attribute {0} after child nodes or before an element is produced. Attribute will be ignored."},
  • 403
  • 404 /*
  • 405 * Note to translators: The stylesheet contained a reference to a
  • 406 * namespace prefix that was undefined. The value of the substitution
  • 407 * text is the name of the prefix.
  • 408 */
  • 409 {ER_NAMESPACE_PREFIX,
  • 410 "Namespace for prefix ''{0}'' has not been declared." },
  • 411 /*
  • 412 * Note to translators: This message is reported if the stylesheet
  • 413 * being processed attempted to construct an XML document with an
  • 414 * attribute in a place other than on an element. The substitution text
  • 415 * specifies the name of the attribute.
  • 416 */
  • 417 {ER_STRAY_ATTRIBUTE,
  • 418 "Attribute ''{0}'' outside of element." },
  • 419
  • 420 /*
  • 421 * Note to translators: As with the preceding message, a namespace
  • 422 * declaration has the form of an attribute and is only permitted to
  • 423 * appear on an element. The substitution text {0} is the namespace
  • 424 * prefix and {1} is the URI that was being used in the erroneous
  • 425 * namespace declaration.
  • 426 */
  • 427 {ER_STRAY_NAMESPACE,
  • 428 "Namespace declaration ''{0}''=''{1}'' outside of element." },
  • 429
  • 430 {ER_COULD_NOT_LOAD_RESOURCE,
  • 431 "Could not load ''{0}'' (check CLASSPATH), now using just the defaults"},
  • 432
  • 433 { ER_ILLEGAL_CHARACTER,
  • 434 "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}."},
  • 435
  • 436 {ER_COULD_NOT_LOAD_METHOD_PROPERTY,
  • 437 "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" }
  • 438
  • 439
  • 440 };
  • 441
  • 442 /**
  • 443 * Get the association list.
  • 444 *
  • 445 * @return The association list.
  • 446 */
  • 447
  • 448 protected Object[][] getContents() {
  • 449 // return a copy of contents; in theory we want a deep clone
  • 450 // of contents, but since it only contains (immutable) Strings,
  • 451 // this shallow copy is sufficient
  • 452 Object[][] msgCopy = new Object[contents.length][2];
  • 453 for (int i = 0; i < contents.length; i++) {
  • 454 msgCopy[i][0] = contents[i][0];
  • 455 msgCopy[i][1] = contents[i][1];
  • 456 }
  • 457 return msgCopy;
  • 458 }
  • 459
  • 460 /**
  • 461 * Return a named ResourceBundle for a particular locale. This method mimics the behavior
  • 462 * of ResourceBundle.getBundle().
  • 463 *
  • 464 * @param className the name of the class that implements the resource bundle.
  • 465 * @return the ResourceBundle
  • 466 * @throws MissingResourceException
  • 467 */
  • 468 public static final XMLErrorResources loadResourceBundle(String className)
  • 469 throws MissingResourceException
  • 470 {
  • 471
  • 472 Locale locale = Locale.getDefault();
  • 473 String suffix = getResourceSuffix(locale);
  • 474
  • 475 try
  • 476 {
  • 477
  • 478 // first try with the given locale
  • 479 return (XMLErrorResources) ResourceBundle.getBundle(className
  • 480 + suffix, locale);
  • 481 }
  • 482 catch (MissingResourceException e)
  • 483 {
  • 484 try // try to fall back to en_US if we can't load
  • 485 {
  • 486
  • 487 // Since we can't find the localized property file,
  • 488 // fall back to en_US.
  • 489 return (XMLErrorResources) ResourceBundle.getBundle(className,
  • 490 new Locale("en", "US"));
  • 491 }
  • 492 catch (MissingResourceException e2)
  • 493 {
  • 494
  • 495 // Now we are really in trouble.
  • 496 // very bad, definitely very bad...not going to get very far
  • 497 throw new MissingResourceException(
  • 498 "Could not load any resource bundles.", className, "");
  • 499 }
  • 500 }
  • 501 }
  • 502
  • 503 /**
  • 504 * Return the resource file suffic for the indicated locale
  • 505 * For most locales, this will be based the language code. However
  • 506 * for Chinese, we do distinguish between Taiwan and PRC
  • 507 *
  • 508 * @param locale the locale
  • 509 * @return an String suffix which canbe appended to a resource name
  • 510 */
  • 511 private static final String getResourceSuffix(Locale locale)
  • 512 {
  • 513
  • 514 String suffix = "_" + locale.getLanguage();
  • 515 String country = locale.getCountry();
  • 516
  • 517 if (country.equals("TW"))
  • 518 suffix += "_" + country;
  • 519
  • 520 return suffix;
  • 521 }
  • 522
  • 523}

文件:XMLErrorResources.java
包名:com.sun.org.apache.xml.internal.res
类名:XMLErrorResources
继承:ListResourceBundle
接口: