Home | History | Annotate | Download | only in utils
      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: SerializerMessages.java 471981 2006-11-07 04:28:00Z minchau $
     20  */
     21 package org.apache.xml.serializer.utils;
     22 
     23 import java.util.ListResourceBundle;
     24 import java.util.Locale;
     25 import java.util.MissingResourceException;
     26 import java.util.ResourceBundle;
     27 
     28 /**
     29  * An instance of this class is a ListResourceBundle that
     30  * has the required getContents() method that returns
     31  * an array of message-key/message associations.
     32  * <p>
     33  * The message keys are defined in {@link MsgKey}. The
     34  * messages that those keys map to are defined here.
     35  * <p>
     36  * The messages in the English version are intended to be
     37  * translated.
     38  *
     39  * This class is not a public API, it is only public because it is
     40  * used in the serializer.
     41  *
     42  * @xsl.usage internal
     43  */
     44 public class SerializerMessages extends ListResourceBundle {
     45 
     46     /*
     47      * This file contains error and warning messages related to
     48      * Serializer Error Handling.
     49      *
     50      *  General notes to translators:
     51 
     52      *  1) A stylesheet is a description of how to transform an input XML document
     53      *     into a resultant XML document (or HTML document or text).  The
     54      *     stylesheet itself is described in the form of an XML document.
     55 
     56      *
     57      *  2) An element is a mark-up tag in an XML document; an attribute is a
     58      *     modifier on the tag.  For example, in <elem attr='val' attr2='val2'>
     59      *     "elem" is an element name, "attr" and "attr2" are attribute names with
     60      *     the values "val" and "val2", respectively.
     61      *
     62      *  3) A namespace declaration is a special attribute that is used to associate
     63      *     a prefix with a URI (the namespace).  The meanings of element names and
     64      *     attribute names that use that prefix are defined with respect to that
     65      *     namespace.
     66      *
     67      *
     68      */
     69 
     70     /** The lookup table for error messages.   */
     71     public Object[][] getContents() {
     72         Object[][] contents = new Object[][] {
     73             {   MsgKey.BAD_MSGKEY,
     74                 "The message key ''{0}'' is not in the message class ''{1}''" },
     75 
     76             {   MsgKey.BAD_MSGFORMAT,
     77                 "The format of message ''{0}'' in message class ''{1}'' failed." },
     78 
     79             {   MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
     80                 "The serializer class ''{0}'' does not implement org.xml.sax.ContentHandler." },
     81 
     82             {   MsgKey.ER_RESOURCE_COULD_NOT_FIND,
     83                     "The resource [ {0} ] could not be found.\n {1}" },
     84 
     85             {   MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
     86                     "The resource [ {0} ] could not load: {1} \n {2} \t {3}" },
     87 
     88             {   MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
     89                     "Buffer size <=0" },
     90 
     91             {   MsgKey.ER_INVALID_UTF16_SURROGATE,
     92                     "Invalid UTF-16 surrogate detected: {0} ?" },
     93 
     94             {   MsgKey.ER_OIERROR,
     95                 "IO error" },
     96 
     97             {   MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
     98                 "Cannot add attribute {0} after child nodes or before an element is produced.  Attribute will be ignored." },
     99 
    100             /*
    101              * Note to translators:  The stylesheet contained a reference to a
    102              * namespace prefix that was undefined.  The value of the substitution
    103              * text is the name of the prefix.
    104              */
    105             {   MsgKey.ER_NAMESPACE_PREFIX,
    106                 "Namespace for prefix ''{0}'' has not been declared." },
    107 
    108             /*
    109              * Note to translators:  This message is reported if the stylesheet
    110              * being processed attempted to construct an XML document with an
    111              * attribute in a place other than on an element.  The substitution text
    112              * specifies the name of the attribute.
    113              */
    114             {   MsgKey.ER_STRAY_ATTRIBUTE,
    115                 "Attribute ''{0}'' outside of element." },
    116 
    117             /*
    118              * Note to translators:  As with the preceding message, a namespace
    119              * declaration has the form of an attribute and is only permitted to
    120              * appear on an element.  The substitution text {0} is the namespace
    121              * prefix and {1} is the URI that was being used in the erroneous
    122              * namespace declaration.
    123              */
    124             {   MsgKey.ER_STRAY_NAMESPACE,
    125                 "Namespace declaration ''{0}''=''{1}'' outside of element." },
    126 
    127             {   MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
    128                 "Could not load ''{0}'' (check CLASSPATH), now using just the defaults" },
    129 
    130             {   MsgKey.ER_ILLEGAL_CHARACTER,
    131                 "Attempt to output character of integral value {0} that is not represented in specified output encoding of {1}." },
    132 
    133             {   MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
    134                 "Could not load the propery file ''{0}'' for output method ''{1}'' (check CLASSPATH)" },
    135 
    136             {   MsgKey.ER_INVALID_PORT,
    137                 "Invalid port number" },
    138 
    139             {   MsgKey.ER_PORT_WHEN_HOST_NULL,
    140                 "Port cannot be set when host is null" },
    141 
    142             {   MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
    143                 "Host is not a well formed address" },
    144 
    145             {   MsgKey.ER_SCHEME_NOT_CONFORMANT,
    146                 "The scheme is not conformant." },
    147 
    148             {   MsgKey.ER_SCHEME_FROM_NULL_STRING,
    149                 "Cannot set scheme from null string" },
    150 
    151             {   MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
    152                 "Path contains invalid escape sequence" },
    153 
    154             {   MsgKey.ER_PATH_INVALID_CHAR,
    155                 "Path contains invalid character: {0}" },
    156 
    157             {   MsgKey.ER_FRAG_INVALID_CHAR,
    158                 "Fragment contains invalid character" },
    159 
    160             {   MsgKey.ER_FRAG_WHEN_PATH_NULL,
    161                 "Fragment cannot be set when path is null" },
    162 
    163             {   MsgKey.ER_FRAG_FOR_GENERIC_URI,
    164                 "Fragment can only be set for a generic URI" },
    165 
    166             {   MsgKey.ER_NO_SCHEME_IN_URI,
    167                 "No scheme found in URI" },
    168 
    169             {   MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
    170                 "Cannot initialize URI with empty parameters" },
    171 
    172             {   MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
    173                 "Fragment cannot be specified in both the path and fragment" },
    174 
    175             {   MsgKey.ER_NO_QUERY_STRING_IN_PATH,
    176                 "Query string cannot be specified in path and query string" },
    177 
    178             {   MsgKey.ER_NO_PORT_IF_NO_HOST,
    179                 "Port may not be specified if host is not specified" },
    180 
    181             {   MsgKey.ER_NO_USERINFO_IF_NO_HOST,
    182                 "Userinfo may not be specified if host is not specified" },
    183 
    184             {   MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
    185                 "Warning:  The version of the output document is requested to be ''{0}''.  This version of XML is not supported.  The version of the output document will be ''1.0''." },
    186 
    187             {   MsgKey.ER_SCHEME_REQUIRED,
    188                 "Scheme is required!" },
    189 
    190             /*
    191              * Note to translators:  The words 'Properties' and
    192              * 'SerializerFactory' in this message are Java class names
    193              * and should not be translated.
    194              */
    195             {   MsgKey.ER_FACTORY_PROPERTY_MISSING,
    196                 "The Properties object passed to the SerializerFactory does not have a ''{0}'' property." },
    197 
    198             {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
    199                 "Warning:  The encoding ''{0}'' is not supported by the Java runtime." },
    200 
    201              {MsgKey.ER_FEATURE_NOT_FOUND,
    202              "The parameter ''{0}'' is not recognized."},
    203 
    204              {MsgKey.ER_FEATURE_NOT_SUPPORTED,
    205              "The parameter ''{0}'' is recognized but the requested value cannot be set."},
    206 
    207              {MsgKey.ER_STRING_TOO_LONG,
    208              "The resulting string is too long to fit in a DOMString: ''{0}''."},
    209 
    210              {MsgKey.ER_TYPE_MISMATCH_ERR,
    211              "The value type for this parameter name is incompatible with the expected value type."},
    212 
    213              {MsgKey.ER_NO_OUTPUT_SPECIFIED,
    214              "The output destination for data to be written to was null."},
    215 
    216              {MsgKey.ER_UNSUPPORTED_ENCODING,
    217              "An unsupported encoding is encountered."},
    218 
    219              {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
    220              "The node could not be serialized."},
    221 
    222              {MsgKey.ER_CDATA_SECTIONS_SPLIT,
    223              "The CDATA Section contains one or more termination markers ']]>'."},
    224 
    225              {MsgKey.ER_WARNING_WF_NOT_CHECKED,
    226                  "An instance of the Well-Formedness checker could not be created.  The well-formed parameter was set to true but well-formedness checking can not be performed."
    227              },
    228 
    229              {MsgKey.ER_WF_INVALID_CHARACTER,
    230                  "The node ''{0}'' contains invalid XML characters."
    231              },
    232 
    233              { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
    234                  "An invalid XML character (Unicode: 0x{0}) was found in the comment."
    235              },
    236 
    237              { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
    238                  "An invalid XML character (Unicode: 0x{0}) was found in the processing instructiondata."
    239              },
    240 
    241              { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
    242                  "An invalid XML character (Unicode: 0x{0}) was found in the contents of the CDATASection."
    243              },
    244 
    245              { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
    246                  "An invalid XML character (Unicode: 0x{0}) was found in the node''s character data content."
    247              },
    248 
    249              { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
    250                  "An invalid XML character(s) was found in the {0} node named ''{1}''."
    251              },
    252 
    253              { MsgKey.ER_WF_DASH_IN_COMMENT,
    254                  "The string \"--\" is not permitted within comments."
    255              },
    256 
    257              {MsgKey.ER_WF_LT_IN_ATTVAL,
    258                  "The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character."
    259              },
    260 
    261              {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
    262                  "The unparsed entity reference \"&{0};\" is not permitted."
    263              },
    264 
    265              {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
    266                  "The external entity reference \"&{0};\" is not permitted in an attribute value."
    267              },
    268 
    269              {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
    270                  "The prefix \"{0}\" can not be bound to namespace \"{1}\"."
    271              },
    272 
    273              {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
    274                  "The local name of element \"{0}\" is null."
    275              },
    276 
    277              {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
    278                  "The local name of attr \"{0}\" is null."
    279              },
    280 
    281              { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
    282                  "The replacement text of the entity node \"{0}\" contains an element node \"{1}\" with an unbound prefix \"{2}\"."
    283              },
    284 
    285              { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
    286                  "The replacement text of the entity node \"{0}\" contains an attribute node \"{1}\" with an unbound prefix \"{2}\"."
    287              },
    288 
    289              { MsgKey.ER_WRITING_INTERNAL_SUBSET,
    290                  "An error occured while writing the internal subset."
    291              },
    292         };
    293 
    294         return contents;
    295     }
    296 }
    297