< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java

Print this page


   1 /*
   2  * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Nov 2017
   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.serializer;
  23 


  36 import java.util.Iterator;
  37 import java.util.List;
  38 import java.util.Properties;
  39 import java.util.Set;
  40 import java.util.StringTokenizer;
  41 import javax.xml.transform.ErrorListener;
  42 import javax.xml.transform.OutputKeys;
  43 import javax.xml.transform.Transformer;
  44 import javax.xml.transform.TransformerException;
  45 import jdk.xml.internal.SecuritySupport;
  46 import org.w3c.dom.Node;
  47 import org.xml.sax.Attributes;
  48 import org.xml.sax.ContentHandler;
  49 import org.xml.sax.SAXException;
  50 
  51 /**
  52  * This abstract class is a base class for other stream
  53  * serializers (xml, html, text ...) that write output to a stream.
  54  *
  55  * @xsl.usage internal

  56  */
  57 abstract public class ToStream extends SerializerBase {
  58 
  59     private static final String COMMENT_BEGIN = "<!--";
  60     private static final String COMMENT_END = "-->";
  61 
  62     /** Stack to keep track of disabling output escaping. */
  63     protected BoolStack m_disableOutputEscapingStates = new BoolStack();
  64 
  65     /**
  66      * The encoding information associated with this serializer.
  67      * Although initially there is no encoding,
  68      * there is a dummy EncodingInfo object that will say
  69      * that every character is in the encoding. This is useful
  70      * for a serializer that is in temporary output state and has
  71      * no associated encoding. A serializer in final output state
  72      * will have an encoding, and will worry about whether
  73      * single chars or surrogate pairs of high/low chars form
  74      * characters in the output encoding.
  75      */


   1 /*
   2  * Copyright (c) 2006, 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.serializer;
  22 


  35 import java.util.Iterator;
  36 import java.util.List;
  37 import java.util.Properties;
  38 import java.util.Set;
  39 import java.util.StringTokenizer;
  40 import javax.xml.transform.ErrorListener;
  41 import javax.xml.transform.OutputKeys;
  42 import javax.xml.transform.Transformer;
  43 import javax.xml.transform.TransformerException;
  44 import jdk.xml.internal.SecuritySupport;
  45 import org.w3c.dom.Node;
  46 import org.xml.sax.Attributes;
  47 import org.xml.sax.ContentHandler;
  48 import org.xml.sax.SAXException;
  49 
  50 /**
  51  * This abstract class is a base class for other stream
  52  * serializers (xml, html, text ...) that write output to a stream.
  53  *
  54  * @xsl.usage internal
  55  * @LastModified: Nov 2017
  56  */
  57 abstract public class ToStream extends SerializerBase {
  58 
  59     private static final String COMMENT_BEGIN = "<!--";
  60     private static final String COMMENT_END = "-->";
  61 
  62     /** Stack to keep track of disabling output escaping. */
  63     protected BoolStack m_disableOutputEscapingStates = new BoolStack();
  64 
  65     /**
  66      * The encoding information associated with this serializer.
  67      * Although initially there is no encoding,
  68      * there is a dummy EncodingInfo object that will say
  69      * that every character is in the encoding. This is useful
  70      * for a serializer that is in temporary output state and has
  71      * no associated encoding. A serializer in final output state
  72      * will have an encoding, and will worry about whether
  73      * single chars or surrogate pairs of high/low chars form
  74      * characters in the output encoding.
  75      */


< prev index next >