< prev index next >

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

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xml.internal.serialize;
  23 
  24 import java.io.OutputStream;
  25 import java.io.OutputStreamWriter;
  26 import java.io.UnsupportedEncodingException;
  27 import java.io.Writer;
  28 import com.sun.org.apache.xerces.internal.util.EncodingMap;
  29 import java.nio.charset.Charset;
  30 import java.nio.charset.CharsetEncoder;
  31 
  32 /**
  33  * This class represents an encoding.
  34  *
  35  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  36  * is replaced by that of Xalan. Main class
  37  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  38  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  39  */

  40 public class EncodingInfo {
  41 
  42     // name of encoding as registered with IANA;
  43     // preferably a MIME name, but aliases are fine too.
  44     String ianaName;
  45     String javaName;
  46     int lastPrintable;
  47 
  48     // The CharsetEncoder with which we test unusual characters.
  49     CharsetEncoder fCharsetEncoder = null;
  50 
  51     // Is the charset encoder usable or available.
  52     boolean fHaveTriedCharsetEncoder = false;
  53 
  54     /**
  55      * Creates new <code>EncodingInfo</code> instance.
  56      */
  57     public EncodingInfo(String ianaName, String javaName, int lastPrintable) {
  58         this.ianaName = ianaName;
  59         this.javaName = EncodingMap.getIANA2JavaMapping(ianaName);


   1 /*
   2  * Copyright (c) 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 package com.sun.org.apache.xml.internal.serialize;
  22 
  23 import java.io.OutputStream;
  24 import java.io.OutputStreamWriter;
  25 import java.io.UnsupportedEncodingException;
  26 import java.io.Writer;
  27 import com.sun.org.apache.xerces.internal.util.EncodingMap;
  28 import java.nio.charset.Charset;
  29 import java.nio.charset.CharsetEncoder;
  30 
  31 /**
  32  * This class represents an encoding.
  33  *
  34  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  35  * is replaced by that of Xalan. Main class
  36  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  37  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  38  */
  39 @Deprecated
  40 public class EncodingInfo {
  41 
  42     // name of encoding as registered with IANA;
  43     // preferably a MIME name, but aliases are fine too.
  44     String ianaName;
  45     String javaName;
  46     int lastPrintable;
  47 
  48     // The CharsetEncoder with which we test unusual characters.
  49     CharsetEncoder fCharsetEncoder = null;
  50 
  51     // Is the charset encoder usable or available.
  52     boolean fHaveTriedCharsetEncoder = false;
  53 
  54     /**
  55      * Creates new <code>EncodingInfo</code> instance.
  56      */
  57     public EncodingInfo(String ianaName, String javaName, int lastPrintable) {
  58         this.ianaName = ianaName;
  59         this.javaName = EncodingMap.getIANA2JavaMapping(ianaName);


< prev index next >