xmlerrorresources.java

来自「JAVA 所有包」· Java 代码 · 共 524 行 · 第 1/2 页

JAVA
524
字号
        { ER_NO_SCHEME_IN_URI,       "No scheme found in URI: {0}"},    { ER_NO_SCHEME_INURI,       "No scheme found in URI"},    { ER_PATH_INVALID_CHAR,       "Path contains invalid character: {0}"},    { ER_SCHEME_FROM_NULL_STRING,       "Cannot set scheme from null string"},    { ER_SCHEME_NOT_CONFORMANT,       "The scheme is not conformant."},    { ER_HOST_ADDRESS_NOT_WELLFORMED,       "Host is not a well formed address"},    { ER_PORT_WHEN_HOST_NULL,       "Port cannot be set when host is null"},    { ER_INVALID_PORT,       "Invalid port number"},    { ER_FRAG_FOR_GENERIC_URI,       "Fragment can only be set for a generic URI"},    { ER_FRAG_WHEN_PATH_NULL,       "Fragment cannot be set when path is null"},    { ER_FRAG_INVALID_CHAR,       "Fragment contains invalid character"},    { ER_PARSER_IN_USE,      "Parser is already in use"},    { ER_CANNOT_CHANGE_WHILE_PARSING,      "Cannot change {0} {1} while parsing"},       { ER_SELF_CAUSATION_NOT_PERMITTED,      "Self-causation not permitted"},    { ER_NO_USERINFO_IF_NO_HOST,      "Userinfo may not be specified if host is not specified"},    { ER_NO_PORT_IF_NO_HOST,      "Port may not be specified if host is not specified"},    { ER_NO_QUERY_STRING_IN_PATH,       "Query string cannot be specified in path and query string"},    { ER_NO_FRAGMENT_STRING_IN_PATH,      "Fragment cannot be specified in both the path and fragment"},    { ER_CANNOT_INIT_URI_EMPTY_PARMS,       "Cannot initialize URI with empty parameters"},    { ER_METHOD_NOT_SUPPORTED,      "Method not yet supported "},        { ER_INCRSAXSRCFILTER_NOT_RESTARTABLE,      "IncrementalSAXSource_Filter not currently restartable"},    { ER_XMLRDR_NOT_BEFORE_STARTPARSE,      "XMLReader not before startParse request"},    { ER_AXIS_TRAVERSER_NOT_SUPPORTED,      "Axis traverser not supported: {0}"},    { ER_ERRORHANDLER_CREATED_WITH_NULL_PRINTWRITER,      "ListingErrorHandler created with null PrintWriter!"},    { ER_SYSTEMID_UNKNOWN,      "SystemId Unknown"},    { ER_LOCATION_UNKNOWN,      "Location of error unknown"},    { ER_PREFIX_MUST_RESOLVE,      "Prefix must resolve to a namespace: {0}"},    { ER_CREATEDOCUMENT_NOT_SUPPORTED,      "createDocument() not supported in XPathContext!"},    { ER_CHILD_HAS_NO_OWNER_DOCUMENT,      "Attribute child does not have an owner document!"},    { ER_CHILD_HAS_NO_OWNER_DOCUMENT_ELEMENT,      "Attribute child does not have an owner document element!"},    { ER_CANT_OUTPUT_TEXT_BEFORE_DOC,      "Warning: can't output text before document element!  Ignoring..."},    { ER_CANT_HAVE_MORE_THAN_ONE_ROOT,      "Can't have more than one root on a DOM!"},    { ER_ARG_LOCALNAME_NULL,       "Argument 'localName' is null"},     // Note to translators:  A QNAME has the syntactic form [NCName:]NCName    // The localname is the portion after the optional colon; the message indicates    // that there is a problem with that part of the QNAME.    { ER_ARG_LOCALNAME_INVALID,       "Localname in QNAME should be a valid NCName"},    // Note to translators:  A QNAME has the syntactic form [NCName:]NCName    // The prefix is the portion before the optional colon; the message indicates    // that there is a problem with that part of the QNAME.    { ER_ARG_PREFIX_INVALID,       "Prefix in QNAME should be a valid NCName"},           { ER_NAME_CANT_START_WITH_COLON,      "Name cannot start with a colon"},           { "BAD_CODE", "Parameter to createMessage was out of bounds"},    { "FORMAT_FAILED", "Exception thrown during messageFormat call"},    { "line", "Line #"},    { "column","Column #"},        {ER_SERIALIZER_NOT_CONTENTHANDLER,      "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler."},        {ER_RESOURCE_COULD_NOT_FIND,      "The resource [ {0} ] could not be found.\n {1}" },        {ER_RESOURCE_COULD_NOT_LOAD,      "The resource [ {0} ] could not load: {1} \n {2} \t {3}" },        {ER_BUFFER_SIZE_LESSTHAN_ZERO,      "Buffer size <=0" },        {ER_INVALID_UTF16_SURROGATE,      "Invalid UTF-16 surrogate detected: {0} ?" },        {ER_OIERROR,      "IO error" },        {ER_ILLEGAL_ATTRIBUTE_POSITION,      "Cannot add attribute {0} after child nodes or before an element is produced.  Attribute will be ignored."},      /*       * Note to translators:  The stylesheet contained a reference to a       * namespace prefix that was undefined.  The value of the substitution       * text is the name of the prefix.       */    {ER_NAMESPACE_PREFIX,      "Namespace for prefix ''{0}'' has not been declared." },      /*       * Note to translators:  This message is reported if the stylesheet       * being processed attempted to construct an XML document with an       * attribute in a place other than on an element.  The substitution text       * specifies the name of the attribute.       */    {ER_STRAY_ATTRIBUTE,      "Attribute ''{0}'' outside of element." },      /*       * Note to translators:  As with the preceding message, a namespace       * declaration has the form of an attribute and is only permitted to       * appear on an element.  The substitution text {0} is the namespace       * prefix and {1} is the URI that was being used in the erroneous       * namespace declaration.       */    {ER_STRAY_NAMESPACE,      "Namespace declaration ''{0}''=''{1}'' outside of element." },    {ER_COULD_NOT_LOAD_RESOURCE,      "Could not load ''{0}'' (check CLASSPATH), now using just the defaults"},    { ER_ILLEGAL_CHARACTER,       "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}."},        {ER_COULD_NOT_LOAD_METHOD_PROPERTY,      "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" }        };  /**   * Get the association list.   *   * @return The association list.   */     protected Object[][] getContents() {	// return a copy of contents; in theory we want a deep clone	// of contents, but since it only contains (immutable) Strings,	// this shallow copy is sufficient	Object[][] msgCopy = new Object[contents.length][2];	for (int i = 0; i < contents.length; i++) {            msgCopy[i][0] = contents[i][0];            msgCopy[i][1] = contents[i][1];	}        return msgCopy;    }  /**   *   Return a named ResourceBundle for a particular locale.  This method mimics the behavior   *   of ResourceBundle.getBundle().   *   *   @param className the name of the class that implements the resource bundle.   *   @return the ResourceBundle   *   @throws MissingResourceException   */  public static final XMLErrorResources loadResourceBundle(String className)          throws MissingResourceException  {    Locale locale = Locale.getDefault();    String suffix = getResourceSuffix(locale);    try    {      // first try with the given locale      return (XMLErrorResources) ResourceBundle.getBundle(className              + suffix, locale);    }    catch (MissingResourceException e)    {      try  // try to fall back to en_US if we can't load      {        // Since we can't find the localized property file,        // fall back to en_US.        return (XMLErrorResources) ResourceBundle.getBundle(className,                new Locale("en", "US"));      }      catch (MissingResourceException e2)      {        // Now we are really in trouble.        // very bad, definitely very bad...not going to get very far        throw new MissingResourceException(          "Could not load any resource bundles.", className, "");      }    }  }  /**   * Return the resource file suffic for the indicated locale   * For most locales, this will be based the language code.  However   * for Chinese, we do distinguish between Taiwan and PRC   *   * @param locale the locale   * @return an String suffix which canbe appended to a resource name   */  private static final String getResourceSuffix(Locale locale)  {    String suffix = "_" + locale.getLanguage();    String country = locale.getCountry();    if (country.equals("TW"))      suffix += "_" + country;    return suffix;  }  }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?