< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/Encodings.java

Print this page


   1 /*
   2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 
  22 package com.sun.org.apache.xml.internal.serialize;


  25 import com.sun.org.apache.xerces.internal.util.EncodingMap;
  26 import java.io.UnsupportedEncodingException;
  27 import java.util.Locale;
  28 import java.util.Map;
  29 import java.util.concurrent.ConcurrentHashMap;
  30 
  31 
  32 /**
  33  * Provides information about encodings. Depends on the Java runtime
  34  * to provides writers for the different encodings, but can be used
  35  * to override encoding names and provide the last printable character
  36  * for each encoding.
  37  *
  38  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  39  *
  40  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  41  * is replaced by that of Xalan. Main class
  42  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  43  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  44  */

  45 class Encodings
  46 {
  47 
  48 
  49     /**
  50      * The last printable character for unknown encodings.
  51      */
  52     static final int DEFAULT_LAST_PRINTABLE = 0x7F;
  53 
  54     // last printable character for Unicode-compatible encodings
  55     static final int LAST_PRINTABLE_UNICODE = 0xffff;
  56     // unicode-compliant encodings; can express plane 0
  57     static final String[] UNICODE_ENCODINGS = {
  58         "Unicode", "UnicodeBig", "UnicodeLittle", "GB2312", "UTF8", "UTF-16",
  59     };
  60     // default (Java) encoding if none supplied:
  61     static final String DEFAULT_ENCODING = "UTF8";
  62 
  63     // note that the size of this Map
  64     // is bounded by the number of encodings recognized by EncodingMap;


   1 /*
   2  * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 
  22 package com.sun.org.apache.xml.internal.serialize;


  25 import com.sun.org.apache.xerces.internal.util.EncodingMap;
  26 import java.io.UnsupportedEncodingException;
  27 import java.util.Locale;
  28 import java.util.Map;
  29 import java.util.concurrent.ConcurrentHashMap;
  30 
  31 
  32 /**
  33  * Provides information about encodings. Depends on the Java runtime
  34  * to provides writers for the different encodings, but can be used
  35  * to override encoding names and provide the last printable character
  36  * for each encoding.
  37  *
  38  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  39  *
  40  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  41  * is replaced by that of Xalan. Main class
  42  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  43  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  44  */
  45 @Deprecated
  46 class Encodings
  47 {
  48 
  49 
  50     /**
  51      * The last printable character for unknown encodings.
  52      */
  53     static final int DEFAULT_LAST_PRINTABLE = 0x7F;
  54 
  55     // last printable character for Unicode-compatible encodings
  56     static final int LAST_PRINTABLE_UNICODE = 0xffff;
  57     // unicode-compliant encodings; can express plane 0
  58     static final String[] UNICODE_ENCODINGS = {
  59         "Unicode", "UnicodeBig", "UnicodeLittle", "GB2312", "UTF8", "UTF-16",
  60     };
  61     // default (Java) encoding if none supplied:
  62     static final String DEFAULT_ENCODING = "UTF8";
  63 
  64     // note that the size of this Map
  65     // is bounded by the number of encodings recognized by EncodingMap;


< prev index next >