jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java
author joehw
Tue, 29 Jul 2014 20:52:36 -0700
changeset 25834 aba3efbf4ec5
parent 12457 c348e06f0e82
permissions -rw-r--r--
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer. Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
25834
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
     6
 * Licensed to the Apache Software Foundation (ASF) under one
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
     7
 * or more contributor license agreements. See the NOTICE file
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
     8
 * distributed with this work for additional information
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
     9
 * regarding copyright ownership. The ASF licenses this file
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
    10
 * to you under the Apache License, Version 2.0 (the  "License");
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 * $Id: Serializer.java,v 1.2.4.1 2005/09/15 08:15:22 suresh_emailid Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
package com.sun.org.apache.xml.internal.serializer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import java.io.IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import java.io.OutputStream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import java.io.Writer;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import java.util.Properties;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import org.xml.sax.ContentHandler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * The Serializer interface is implemented by a serializer to enable users to:
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * <li>get and set streams or writers
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * <li>configure the serializer with key/value properties
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * <li>get an org.xml.sax.ContentHandler or a DOMSerializer to provide input to
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * Here is an example using the asContentHandler() method:
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * java.util.Properties props =
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *   OutputPropertiesFactory.getDefaultMethodProperties(Method.TEXT);
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * Serializer ser = SerializerFactory.getSerializer(props);
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * java.io.PrintStream ostream = System.out;
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * ser.setOutputStream(ostream);
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * // Provide the SAX input events
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * ContentHandler handler = ser.asContentHandler();
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * handler.startDocument();
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * char[] chars = { 'a', 'b', 'c' };
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * handler.characters(chars, 0, chars.length);
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * handler.endDocument();
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * ser.reset(); // get ready to use the serializer for another document
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 *              // of the same output method (TEXT).
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * As an alternate to supplying a series of SAX events as input through the
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * ContentHandler interface, the input to serialize may be given as a DOM.
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 * For example:
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * <pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 * org.w3c.dom.Document     inputDoc;
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * com.sun.org.apache.xml.internal.serializer.Serializer   ser;
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * java.io.Writer owriter;
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 * java.util.Properties props =
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 *   OutputPropertiesFactory.getDefaultMethodProperties(Method.XML);
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * Serializer ser = SerializerFactory.getSerializer(props);
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * owriter = ...;  // create a writer to serialize the document to
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 * ser.setWriter( owriter );
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * inputDoc = ...; // create the DOM document to be serialized
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 * DOMSerializer dser = ser.asDOMSerializer(); // a DOM will be serialized
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 * dser.serialize(inputDoc); // serialize the DOM, sending output to owriter
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 * ser.reset(); // get ready to use the serializer for another document
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
 *              // of the same output method.
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
 * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
 * This interface is a public API.
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
 * @see Method
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
 * @see OutputPropertiesFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
 * @see SerializerFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
 * @see DOMSerializer
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
 * @see ContentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
 * @xsl.usage general
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
public interface Serializer {
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     * Specifies an output stream to which the document should be
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * serialized. This method should not be called while the
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * serializer is in the process of serializing a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     * The encoding specified in the output {@link Properties} is used, or
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     * if no encoding was specified, the default for the selected
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     * output method.
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * Only one of setWriter() or setOutputStream() should be called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     * @param output The output stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
    public void setOutputStream(OutputStream output);
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * Get the output stream where the events will be serialized to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * @return reference to the result stream, or null if only a writer was
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     * set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
    public OutputStream getOutputStream();
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     * Specifies a writer to which the document should be serialized.
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     * This method should not be called while the serializer is in
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     * the process of serializing a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     * The encoding specified for the output {@link Properties} must be
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     * identical to the output format used with the writer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     * Only one of setWriter() or setOutputStream() should be called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * @param writer The output writer stream
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
    public void setWriter(Writer writer);
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * Get the character stream where the events will be serialized to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     * @return Reference to the result Writer, or null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
    public Writer getWriter();
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
     * Specifies an output format for this serializer. It the
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
     * serializer has already been associated with an output format,
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
     * it will switch to the new format. This method should not be
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     * called while the serializer is in the process of serializing
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * The standard property keys supported are: "method", "version", "encoding",
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * "omit-xml-declaration", "standalone", doctype-public",
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     * "doctype-system", "cdata-section-elements", "indent", "media-type".
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * These property keys and their values are described in the XSLT recommendation,
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * see {@link <a href="http://www.w3.org/TR/1999/REC-xslt-19991116"> XSLT 1.0 recommendation</a>}
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
     * The non-standard property keys supported are defined in {@link OutputPropertiesFactory}.
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     * This method can be called multiple times before a document is serialized. Each
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     * time it is called more, or over-riding property values, can be specified. One
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     * property value that can not be changed is that of the "method" property key.
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     * The value of the "cdata-section-elements" property key is a whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     * separated list of elements. If the element is in a namespace then
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     * value is passed in this format: {uri}localName
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
     * If the "cdata-section-elements" key is specified on multiple calls
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
     * to this method the set of elements specified in the value
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
     * is not replaced from one call to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
     * next, but it is cumulative across the calls.
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
     * @param format The output format to use, as a set of key/value pairs.
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
    public void setOutputFormat(Properties format);
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * Returns the output format properties for this serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     * @return The output format key/value pairs in use.
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
    public Properties getOutputFormat();
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     * Return a {@link ContentHandler} interface to provide SAX input to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     * Through the returned object the document to be serailized,
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     * as a series of SAX events, can be provided to the serialzier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     * If the serializer does not support the {@link ContentHandler}
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
     * interface, it will return null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
     * In principle only one of asDOMSerializer() or asContentHander()
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
     * should be called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
     * @return A {@link ContentHandler} interface into this serializer,
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
     *  or null if the serializer is not SAX 2 capable
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
     * @throws IOException An I/O exception occured
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
    public ContentHandler asContentHandler() throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     * Return a {@link DOMSerializer} interface into this serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     * Through the returned object the document to be serialized,
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     * a DOM, can be provided to the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
     * If the serializer does not support the {@link DOMSerializer}
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
     * interface, it should return null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
     * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
     * In principle only one of asDOMSerializer() or asContentHander()
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
     * should be called.
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
     * @return A {@link DOMSerializer} interface into this serializer,
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
     *  or null if the serializer is not DOM capable
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
     * @throws IOException An I/O exception occured
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
    public DOMSerializer asDOMSerializer() throws IOException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
     * This method resets the serializer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
     * If this method returns true, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
     * serializer may be used for subsequent serialization of new
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
     * documents. It is possible to change the output format and
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
     * output stream prior to serializing, or to reuse the existing
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
     * output format and output stream or writer.
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
     * @return True if serializer has been reset and can be reused
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
    public boolean reset();
25834
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   225
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   226
    /**
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   227
     * Return an Object into this serializer to be cast to a DOM3Serializer.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   228
     * Through the returned object the document to be serialized,
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   229
     * a DOM (Level 3), can be provided to the serializer.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   230
     * If the serializer does not support casting to a {@link DOM3Serializer}
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   231
     * interface, it should return null.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   232
     * <p>
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   233
     * In principle only one of asDOM3Serializer() or asContentHander()
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   234
     * should be called.
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   235
     *
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   236
     * @return An Object to be cast to a DOM3Serializer interface into this serializer,
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   237
     *  or null if the serializer is not DOM capable
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   238
     * @throws IOException An I/O exception occured
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   239
     */
aba3efbf4ec5 8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents: 12457
diff changeset
   240
    public Object asDOM3Serializer() throws IOException;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
}