Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*2 * Copyright 1999-2004 The Apache Software Foundation.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16 /*17 * $Id: Serializer.java,v 1.8 2004/02/16 20:27:14 minchau Exp $18 */19 package org.apache.xalan.serialize;20 21 importjava.io.IOException;22 importjava.io.OutputStream;23 importjava.io.Writer;24 importjava.util.Properties;25 26 importorg.xml.sax.ContentHandler;27 28 /**29 * The Serializer interface is implemented by Serializers to publish methods30 * to get and set streams and writers, to set the output properties, and31 * get the Serializer as a ContentHandler or DOMSerializer.32 * @deprecated Use org.apache.xml.serializer.Serializer33 */34 publicinterface Serializer35 {36 37 /**38 * Specifies an output stream to which the document should be39 * serialized. This method should not be called while the40 * serializer is in the process of serializing a document.41 * <p>42 * The encoding specified in the output {@link Properties} is used, or43 * if no encoding was specified, the default for the selected44 * output method.45 *46 * @param output The output stream47 * 48 * @deprecated Use org.apache.xml.serializer.Serializer49 */50 publicvoid setOutputStream(OutputStream output);51 52 /**53 * Get the output stream where the events will be serialized to.54 *55 * @return reference to the result stream, or null of only a writer was56 * set.57 * @deprecated Use org.apache.xml.serializer.Serializer58 */59 publicOutputStream getOutputStream();60 61 /**62 * Specifies a writer to which the document should be serialized.63 * This method should not be called while the serializer is in64 * the process of serializing a document.65 * <p>66 * The encoding specified for the output {@link Properties} must be67 * identical to the output format used with the writer.68 *69 * @param writer The output writer stream70 * 71 * @deprecated Use org.apache.xml.serializer.Serializer72 */73 publicvoid setWriter(Writer writer);74 75 /**76 * Get the character stream where the events will be serialized to.77 *78 * @return Reference to the result Writer, or null.79 * @deprecated Use org.apache.xml.serializer.Serializer80 */81 publicWriter getWriter();82 83 /**84 * Specifies an output format for this serializer. It the85 * serializer has already been associated with an output format,86 * it will switch to the new format. This method should not be87 * called while the serializer is in the process of serializing88 * a document.89 *90 * @param format The output format to use91 * 92 * @deprecated Use org.apache.xml.serializer.Serializer93 */94 publicvoid setOutputFormat(Properties format);95 96 /**97 * Returns the output format for this serializer.98 *99 * @return The output format in use100 * @deprecated Use org.apache.xml.serializer.Serializer101 */102 publicProperties getOutputFormat();103 104 /**105 * Return a {@link ContentHandler} interface into this serializer.106 * If the serializer does not support the {@link ContentHandler}107 * interface, it should return null.108 *109 * @return A {@link ContentHandler} interface into this serializer,110 * or null if the serializer is not SAX 2 capable111 * @throws IOException An I/O exception occured112 * @deprecated Use org.apache.xml.serializer.Serializer113 */114 publicContentHandler asContentHandler() throwsIOException;115 116 /**117 * Return a {@link DOMSerializer} interface into this serializer.118 * If the serializer does not support the {@link DOMSerializer}119 * interface, it should return null.120 *121 * @return A {@link DOMSerializer} interface into this serializer,122 * or null if the serializer is not DOM capable123 * @throws IOException An I/O exception occured124 * @deprecated Use org.apache.xml.serializer.Serializer125 */126 publicDOMSerializer asDOMSerializer() throwsIOException;127 128 /**129 * Resets the serializer. If this method returns true, the130 * serializer may be used for subsequent serialization of new131 * documents. It is possible to change the output format and132 * output stream prior to serializing, or to use the existing133 * output format and output stream.134 *135 * @return True if serializer has been reset and can be reused136 * 137 * @deprecated Use org.apache.xml.serializer.Serializer138 */139 publicboolean reset();140 }141