xpatherrorresources.java
来自「JAVA的一些源码 JAVA2 STANDARD EDITION DEVELO」· Java 代码 · 共 1,432 行 · 第 1/4 页
JAVA
1,432 行
/** Field ER_EMPTY_XPATH_RESULT */// public static final int ER_EMPTY_XPATH_RESULT = 109; { ER_EMPTY_XPATH_RESULT, "Empty XPath result object"}, /** Field ER_INCOMPATIBLE_TYPES */// public static final int ER_INCOMPATIBLE_TYPES = 110; { ER_INCOMPATIBLE_TYPES, "The returned type: {0} cannot be coerced into the specified type: {1}"}, /** Field ER_NULL_RESOLVER */ // public static final int ER_NULL_RESOLVER = 111; { ER_NULL_RESOLVER, "Unable to resolve prefix with null prefix resolver."}, // Note to translators: The substitution text is the name of a data type. The // message indicates that a value of a particular type could not be converted // to a value of type string. /** Field ER_CANT_CONVERT_TO_STRING */// public static final int ER_CANT_CONVERT_TO_STRING = 112; { ER_CANT_CONVERT_TO_STRING, "Cannot convert {0} to a string."}, // Note to translators: Do not translate snapshotItem, // UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE. /** Field ER_NON_SNAPSHOT_TYPE */// public static final int ER_NON_SNAPSHOT_TYPE = 113; { ER_NON_SNAPSHOT_TYPE, "Cannot call snapshotItem on type: {0}. This method applies to types UNORDERED_NODE_SNAPSHOT_TYPE and ORDERED_NODE_SNAPSHOT_TYPE."}, // Note to translators: XPathEvaluator is a Java interface name. An // XPathEvaluator is created with respect to a particular XML document, and in // this case the expression represented by this object was being evaluated with // respect to a context node from a different document. /** Field ER_WRONG_DOCUMENT */// public static final int ER_WRONG_DOCUMENT = 114; { ER_WRONG_DOCUMENT, "Context node does not belong to the document that is bound to this XPathEvaluator."}, // Note to translators: The XPath expression cannot be evaluated with respect // to this type of node. /** Field ER_WRONG_NODETYPE */// public static final int ER_WRONG_NODETYPE = 115; { ER_WRONG_NODETYPE, "The context node type is not supported."}, /** Field ER_XPATH_ERROR */// public static final int ER_XPATH_ERROR = 116; { ER_XPATH_ERROR, "Unknown error in XPath."},//BEGIN: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation /** Field ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED */ { ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED, "Extension function: {0} can not be invoked when XPathConstants.FEATURE_SECURE_PROCESSING feature is set to true"}, /** Field ER_RESOLVE_VARIABLE_RETURNS_NULL */ { ER_RESOLVE_VARIABLE_RETURNS_NULL, "resolveVariable for variable {0} returning null"}, /** Field ER_UNSUPPORTED_RETURN_TYPE */ { ER_UNSUPPORTED_RETURN_TYPE, "UnSupported Return Type : {0}"}, /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */ { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, "Source and/or Return Type can not be null"}, /** Field ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL */ { ER_SOURCE_RETURN_TYPE_CANNOT_BE_NULL, "Source and/or Return Type can not be null"}, /** Field ER_ARG_CANNOT_BE_NULL */ { ER_ARG_CANNOT_BE_NULL, "{0} argument can not be null"}, /** Field ER_OBJECT_MODEL_NULL */ { ER_OBJECT_MODEL_NULL, "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == null"}, /** Field ER_OBJECT_MODEL_EMPTY */ { ER_OBJECT_MODEL_EMPTY, "{0}#isObjectModelSupported( String objectModel ) cannot be called with objectModel == \"\""}, /** Field ER_OBJECT_MODEL_EMPTY */ { ER_FEATURE_NAME_NULL, "Trying to set a feature with a null name: {0}#setFeature( null, {1})"}, /** Field ER_FEATURE_UNKNOWN */ { ER_FEATURE_UNKNOWN, "Trying to set the unknown feature \"{0}\":{1}#setFeature({0},{2})"}, /** Field ER_GETTING_NULL_FEATURE */ { ER_GETTING_NULL_FEATURE, "Trying to get a feature with a null name: {0}#getFeature(null)"}, /** Field ER_GETTING_NULL_FEATURE */ { ER_GETTING_UNKNOWN_FEATURE, "Trying to get the unknown feature \"{0}\":{1}#getFeature({0})"}, /** Field ER_NULL_XPATH_FUNCTION_RESOLVER */ { ER_NULL_XPATH_FUNCTION_RESOLVER, "Attempting to set a null XPathFunctionResolver:{0}#setXPathFunctionResolver(null)"}, /** Field ER_NULL_XPATH_VARIABLE_RESOLVER */ { ER_NULL_XPATH_VARIABLE_RESOLVER, "Attempting to set a null XPathVariableResolver:{0}#setXPathVariableResolver(null)"},//END: Definitions of error keys used in exception messages of JAXP 1.3 XPath API implementation // Warnings... /** Field WG_LOCALE_NAME_NOT_HANDLED */// public static final int WG_LOCALE_NAME_NOT_HANDLED = 1; { WG_LOCALE_NAME_NOT_HANDLED, "locale name in the format-number function not yet handled!"}, /** Field WG_PROPERTY_NOT_SUPPORTED */// public static final int WG_PROPERTY_NOT_SUPPORTED = 2; { WG_PROPERTY_NOT_SUPPORTED, "XSL Property not supported: {0}"}, /** Field WG_DONT_DO_ANYTHING_WITH_NS */// public static final int WG_DONT_DO_ANYTHING_WITH_NS = 3; { WG_DONT_DO_ANYTHING_WITH_NS, "Do not currently do anything with namespace {0} in property: {1}"}, /** Field WG_SECURITY_EXCEPTION */// public static final int WG_SECURITY_EXCEPTION = 4; { WG_SECURITY_EXCEPTION, "SecurityException when trying to access XSL system property: {0}"}, /** Field WG_QUO_NO_LONGER_DEFINED */// public static final int WG_QUO_NO_LONGER_DEFINED = 5; { WG_QUO_NO_LONGER_DEFINED, "Old syntax: quo(...) is no longer defined in XPath."}, /** Field WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST */// public static final int WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST = 6; { WG_NEED_DERIVED_OBJECT_TO_IMPLEMENT_NODETEST, "XPath needs a derived object to implement nodeTest!"}, /** Field WG_FUNCTION_TOKEN_NOT_FOUND */// public static final int WG_FUNCTION_TOKEN_NOT_FOUND = 7; { WG_FUNCTION_TOKEN_NOT_FOUND, "function token not found."}, /** Field WG_COULDNOT_FIND_FUNCTION */// public static final int WG_COULDNOT_FIND_FUNCTION = 8; { WG_COULDNOT_FIND_FUNCTION, "Could not find function: {0}"}, /** Field WG_CANNOT_MAKE_URL_FROM */// public static final int WG_CANNOT_MAKE_URL_FROM = 9; { WG_CANNOT_MAKE_URL_FROM, "Can not make URL from: {0}"}, /** Field WG_EXPAND_ENTITIES_NOT_SUPPORTED */// public static final int WG_EXPAND_ENTITIES_NOT_SUPPORTED = 10; { WG_EXPAND_ENTITIES_NOT_SUPPORTED, "-E option not supported for DTM parser"}, /** Field WG_ILLEGAL_VARIABLE_REFERENCE */// public static final int WG_ILLEGAL_VARIABLE_REFERENCE = 11; { WG_ILLEGAL_VARIABLE_REFERENCE, "VariableReference given for variable out of context or without definition! Name = {0}"}, /** Field WG_UNSUPPORTED_ENCODING */// public static final int WG_UNSUPPORTED_ENCODING = 12; { WG_UNSUPPORTED_ENCODING, "Unsupported encoding: {0}"}, // Other miscellaneous text used inside the code... { "ui_language", "en"}, { "help_language", "en"}, { "language", "en"}, { "BAD_CODE", "Parameter to createMessage was out of bounds"}, { "FORMAT_FAILED", "Exception thrown during messageFormat call"}, { "version", ">>>>>>> Xalan Version "}, { "version2", "<<<<<<<"}, { "yes", "yes"}, { "line", "Line #"}, { "column", "Column #"}, { "xsldone", "XSLProcessor: done"}, { "xpath_option", "xpath options: "}, { "optionIN", " [-in inputXMLURL]"}, { "optionSelect", " [-select xpath expression]"}, { "optionMatch", " [-match match pattern (for match diagnostics)]"}, { "optionAnyExpr", "Or just an xpath expression will do a diagnostic dump"}, { "noParsermsg1", "XSL Process was not successful."}, { "noParsermsg2", "** Could not find parser **"}, { "noParsermsg3", "Please check your classpath."}, { "noParsermsg4", "If you don't have IBM's XML Parser for Java, you can download it from"}, { "noParsermsg5", "IBM's AlphaWorks: http://www.alphaworks.ibm.com/formula/xml"}, { "gtone", ">1" }, { "zero", "0" }, { "one", "1" }, { "two" , "2" }, { "three", "3" } }; // ================= INFRASTRUCTURE ====================== /** Field BAD_CODE */ public static final String BAD_CODE = "BAD_CODE"; /** Field FORMAT_FAILED */ public static final String FORMAT_FAILED = "FORMAT_FAILED"; /** Field ERROR_RESOURCES */ public static final String ERROR_RESOURCES = "com.sun.org.apache.xpath.internal.res.XPATHErrorResources"; /** Field ERROR_STRING */ public static final String ERROR_STRING = "#error"; /** Field ERROR_HEADER */ public static final String ERROR_HEADER = "Error: "; /** Field WARNING_HEADER */ public static final String WARNING_HEADER = "Warning: "; /** Field XSL_HEADER */ public static final String XSL_HEADER = "XSL "; /** Field XML_HEADER */ public static final String XML_HEADER = "XML "; /** Field QUERY_HEADER */ public static final String QUERY_HEADER = "PATTERN "; /** * 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 res the name of the resource to load. * @param locale the locale to prefer when searching for the bundle * * @param className Name of local-specific subclass. * @return the ResourceBundle * @throws MissingResourceException */ public static final XPATHErrorResources loadResourceBundle(String className) throws MissingResourceException { Locale locale = Locale.getDefault(); String suffix = getResourceSuffix(locale); try { // first try with the given locale return (XPATHErrorResources) 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 (XPATHErrorResources) 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 + -
显示快捷键?