KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > serialize > Serializer


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 at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * 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 and
14  * 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 import java.io.IOException JavaDoc;
22 import java.io.OutputStream JavaDoc;
23 import java.io.Writer JavaDoc;
24 import java.util.Properties JavaDoc;
25
26 import org.xml.sax.ContentHandler JavaDoc;
27
28 /**
29  * The Serializer interface is implemented by Serializers to publish methods
30  * to get and set streams and writers, to set the output properties, and
31  * get the Serializer as a ContentHandler or DOMSerializer.
32  * @deprecated Use org.apache.xml.serializer.Serializer
33  */

34 public interface Serializer
35 {
36
37   /**
38    * Specifies an output stream to which the document should be
39    * serialized. This method should not be called while the
40    * serializer is in the process of serializing a document.
41    * <p>
42    * The encoding specified in the output {@link Properties} is used, or
43    * if no encoding was specified, the default for the selected
44    * output method.
45    *
46    * @param output The output stream
47    *
48    * @deprecated Use org.apache.xml.serializer.Serializer
49    */

50   public void setOutputStream(OutputStream JavaDoc 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 was
56    * set.
57    * @deprecated Use org.apache.xml.serializer.Serializer
58    */

59   public OutputStream JavaDoc 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 in
64    * the process of serializing a document.
65    * <p>
66    * The encoding specified for the output {@link Properties} must be
67    * identical to the output format used with the writer.
68    *
69    * @param writer The output writer stream
70    *
71    * @deprecated Use org.apache.xml.serializer.Serializer
72    */

73   public void setWriter(Writer JavaDoc 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.Serializer
80    */

81   public Writer JavaDoc getWriter();
82
83   /**
84    * Specifies an output format for this serializer. It the
85    * serializer has already been associated with an output format,
86    * it will switch to the new format. This method should not be
87    * called while the serializer is in the process of serializing
88    * a document.
89    *
90    * @param format The output format to use
91    *
92    * @deprecated Use org.apache.xml.serializer.Serializer
93    */

94   public void setOutputFormat(Properties JavaDoc format);
95
96   /**
97    * Returns the output format for this serializer.
98    *
99    * @return The output format in use
100    * @deprecated Use org.apache.xml.serializer.Serializer
101    */

102   public Properties JavaDoc 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 capable
111    * @throws IOException An I/O exception occured
112    * @deprecated Use org.apache.xml.serializer.Serializer
113    */

114   public ContentHandler JavaDoc asContentHandler() throws IOException JavaDoc;
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 capable
123    * @throws IOException An I/O exception occured
124    * @deprecated Use org.apache.xml.serializer.Serializer
125    */

126   public DOMSerializer asDOMSerializer() throws IOException JavaDoc;
127
128   /**
129    * Resets the serializer. If this method returns true, the
130    * serializer may be used for subsequent serialization of new
131    * documents. It is possible to change the output format and
132    * output stream prior to serializing, or to use the existing
133    * output format and output stream.
134    *
135    * @return True if serializer has been reset and can be reused
136    *
137    * @deprecated Use org.apache.xml.serializer.Serializer
138    */

139   public boolean reset();
140 }
141
Popular Tags