< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/TextSerializer.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 
  23 // Sep 14, 2000:


  48  * as specified in the output format.
  49  * <p>
  50  * The serializer supports both DOM and SAX. DOM serializing is done
  51  * by calling {@link #serialize} and SAX serializing is done by firing
  52  * SAX events and using the serializer as a document handler.
  53  * <p>
  54  * If an I/O exception occurs while serializing, the serializer
  55  * will not throw an exception directly, but only throw it
  56  * at the end of serializing (either DOM or SAX's {@link
  57  * org.xml.sax.DocumentHandler#endDocument}.
  58  *
  59  *
  60  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  61  * @see Serializer
  62  *
  63  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  64  * is replaced by that of Xalan. Main class
  65  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  66  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  67  */

  68 public class TextSerializer
  69     extends BaseMarkupSerializer
  70 {
  71 
  72 
  73     /**
  74      * Constructs a new serializer. The serializer cannot be used without
  75      * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
  76      * first.
  77      */
  78     public TextSerializer()
  79     {
  80         super( new OutputFormat( Method.TEXT, null, false ) );
  81     }
  82 
  83 
  84     public void setOutputFormat( OutputFormat format )
  85     {
  86         super.setOutputFormat( format != null ? format : new OutputFormat( Method.TEXT, null, false ) );
  87     }


   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 
  22 // Sep 14, 2000:


  47  * as specified in the output format.
  48  * <p>
  49  * The serializer supports both DOM and SAX. DOM serializing is done
  50  * by calling {@link #serialize} and SAX serializing is done by firing
  51  * SAX events and using the serializer as a document handler.
  52  * <p>
  53  * If an I/O exception occurs while serializing, the serializer
  54  * will not throw an exception directly, but only throw it
  55  * at the end of serializing (either DOM or SAX's {@link
  56  * org.xml.sax.DocumentHandler#endDocument}.
  57  *
  58  *
  59  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  60  * @see Serializer
  61  *
  62  * @deprecated As of JDK 9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation
  63  * is replaced by that of Xalan. Main class
  64  * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
  65  * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
  66  */
  67 @Deprecated
  68 public class TextSerializer
  69     extends BaseMarkupSerializer
  70 {
  71 
  72 
  73     /**
  74      * Constructs a new serializer. The serializer cannot be used without
  75      * calling {@link #setOutputCharStream} or {@link #setOutputByteStream}
  76      * first.
  77      */
  78     public TextSerializer()
  79     {
  80         super( new OutputFormat( Method.TEXT, null, false ) );
  81     }
  82 
  83 
  84     public void setOutputFormat( OutputFormat format )
  85     {
  86         super.setOutputFormat( format != null ? format : new OutputFormat( Method.TEXT, null, false ) );
  87     }


< prev index next >