KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > serializer > SerializationHandler


1 /*
2  * Copyright 2003-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: SerializationHandler.java,v 1.4 2004/02/17 04:18:18 minchau Exp $
18  */

19 package com.sun.org.apache.xml.internal.serializer;
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 import java.util.Vector JavaDoc;
26
27 import javax.xml.transform.Transformer JavaDoc;
28
29 import com.sun.org.apache.xml.internal.serializer.Serializer;
30 import org.w3c.dom.Node JavaDoc;
31 import org.xml.sax.ContentHandler JavaDoc;
32 import org.xml.sax.ErrorHandler JavaDoc;
33 import org.xml.sax.SAXException JavaDoc;
34 import org.xml.sax.ext.DeclHandler JavaDoc;
35
36 /**
37  * This interface is the one that a serializer implements. It is a group of
38  * other interfaces, such as ExtendedContentHandler, ExtendedLexicalHandler etc.
39  * In addition there are other methods, such as reset().
40  */

41 public interface SerializationHandler
42     extends
43         ExtendedContentHandler,
44         ExtendedLexicalHandler,
45         XSLOutputAttributes,
46         DeclHandler JavaDoc,
47         ErrorHandler JavaDoc,
48         DOMSerializer,
49         Serializer
50 {
51     /**
52      * Set the SAX Content handler that the serializer sends its output to. This
53      * method only applies to a ToSAXHandler, not to a ToStream serializer.
54      *
55      * @see com.sun.org.apache.xml.internal.serializer.Serializer#asContentHandler()
56      * @see com.sun.org.apache.xml.internal.serializer.ToSAXHandler
57      */

58     public void setContentHandler(ContentHandler JavaDoc ch);
59     
60     public void close();
61
62     /**
63      * Notify that the serializer should take this DOM node as input to be
64      * serialized.
65      *
66      * @param node the DOM node to be serialized.
67      * @throws IOException
68      */

69     public void serialize(Node JavaDoc node) throws IOException JavaDoc;
70     /**
71      * Turns special character escaping on/off.
72      *
73      * Note that characters will
74      * never, even if this option is set to 'true', be escaped within
75      * CDATA sections in output XML documents.
76      *
77      * @param true if escaping is to be set on.
78      */

79     public boolean setEscaping(boolean escape) throws SAXException JavaDoc;
80
81     /**
82      * Set the number of spaces to indent for each indentation level.
83      * @param spaces the number of spaces to indent for each indentation level.
84      */

85     public void setIndentAmount(int spaces);
86
87     /**
88      * Set the transformer associated with the serializer.
89      * @param transformer the transformer associated with the serializer.
90      */

91     public void setTransformer(Transformer JavaDoc transformer);
92     
93     /**
94      * Get the transformer associated with the serializer.
95      * @return Transformer the transformer associated with the serializer.
96      */

97     public Transformer JavaDoc getTransformer();
98
99     /**
100      * Used only by TransformerSnapshotImpl to restore the serialization
101      * to a previous state.
102      *
103      * @param NamespaceMappings
104      */

105     public void setNamespaceMappings(NamespaceMappings mappings);
106
107     /**
108      * Flush any pending events currently queued up in the serializer. This will
109      * flush any input that the serializer has which it has not yet sent as
110      * output.
111      */

112     public void flushPending() throws SAXException JavaDoc;
113
114
115 }
116
Popular Tags