author | joehw |
Tue, 29 Jul 2014 20:52:36 -0700 | |
changeset 25834 | aba3efbf4ec5 |
parent 12458 | d601e4bba306 |
permissions | -rw-r--r-- |
6 | 1 |
/* |
2 |
* reserved comment block |
|
3 |
* DO NOT REMOVE OR ALTER! |
|
4 |
*/ |
|
5 |
/* |
|
25834
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
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:
12458
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:
12458
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:
12458
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:
12458
diff
changeset
|
10 |
* to you under the Apache License, Version 2.0 (the "License"); |
6 | 11 |
* you may not use this file except in compliance with the License. |
12 |
* You may obtain a copy of the License at |
|
13 |
* |
|
14 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
15 |
* |
|
16 |
* Unless required by applicable law or agreed to in writing, software |
|
17 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
18 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
19 |
* See the License for the specific language governing permissions and |
|
20 |
* limitations under the License. |
|
21 |
*/ |
|
22 |
/* |
|
23 |
* $Id: SerializationHandler.java,v 1.2.4.1 2005/09/15 08:15:22 suresh_emailid Exp $ |
|
24 |
*/ |
|
25 |
package com.sun.org.apache.xml.internal.serializer; |
|
26 |
||
27 |
import java.io.IOException; |
|
28 |
||
29 |
import javax.xml.transform.Transformer; |
|
30 |
||
31 |
import org.w3c.dom.Node; |
|
32 |
import org.xml.sax.ContentHandler; |
|
33 |
import org.xml.sax.ErrorHandler; |
|
34 |
import org.xml.sax.SAXException; |
|
35 |
import org.xml.sax.ext.DeclHandler; |
|
36 |
||
37 |
/** |
|
38 |
* This interface is the one that a serializer implements. It is a group of |
|
39 |
* other interfaces, such as ExtendedContentHandler, ExtendedLexicalHandler etc. |
|
40 |
* In addition there are other methods, such as reset(). |
|
41 |
* |
|
42 |
* This class is public only because it is used in another package, |
|
43 |
* it is not a public API. |
|
44 |
* |
|
45 |
* @xsl.usage internal |
|
46 |
*/ |
|
47 |
public interface SerializationHandler |
|
48 |
extends |
|
49 |
ExtendedContentHandler, |
|
50 |
ExtendedLexicalHandler, |
|
51 |
XSLOutputAttributes, |
|
52 |
DeclHandler, |
|
53 |
org.xml.sax.DTDHandler, |
|
54 |
ErrorHandler, |
|
55 |
DOMSerializer, |
|
56 |
Serializer |
|
57 |
{ |
|
58 |
/** |
|
59 |
* Set the SAX Content handler that the serializer sends its output to. This |
|
60 |
* method only applies to a ToSAXHandler, not to a ToStream serializer. |
|
61 |
* |
|
62 |
* @see Serializer#asContentHandler() |
|
63 |
* @see ToSAXHandler |
|
64 |
*/ |
|
65 |
public void setContentHandler(ContentHandler ch); |
|
66 |
||
67 |
public void close(); |
|
68 |
||
69 |
/** |
|
70 |
* Notify that the serializer should take this DOM node as input to be |
|
71 |
* serialized. |
|
72 |
* |
|
73 |
* @param node the DOM node to be serialized. |
|
74 |
* @throws IOException |
|
75 |
*/ |
|
76 |
public void serialize(Node node) throws IOException; |
|
77 |
/** |
|
78 |
* Turns special character escaping on/off. |
|
79 |
* |
|
80 |
* Note that characters will |
|
81 |
* never, even if this option is set to 'true', be escaped within |
|
82 |
* CDATA sections in output XML documents. |
|
83 |
* |
|
84 |
* @param escape true if escaping is to be set on. |
|
85 |
*/ |
|
86 |
public boolean setEscaping(boolean escape) throws SAXException; |
|
87 |
||
88 |
/** |
|
89 |
* Set the number of spaces to indent for each indentation level. |
|
90 |
* @param spaces the number of spaces to indent for each indentation level. |
|
91 |
*/ |
|
92 |
public void setIndentAmount(int spaces); |
|
93 |
||
94 |
/** |
|
95 |
* Set the transformer associated with the serializer. |
|
96 |
* @param transformer the transformer associated with the serializer. |
|
97 |
*/ |
|
98 |
public void setTransformer(Transformer transformer); |
|
99 |
||
100 |
/** |
|
101 |
* Get the transformer associated with the serializer. |
|
102 |
* @return Transformer the transformer associated with the serializer. |
|
103 |
*/ |
|
104 |
public Transformer getTransformer(); |
|
105 |
||
106 |
/** |
|
107 |
* Used only by TransformerSnapshotImpl to restore the serialization |
|
108 |
* to a previous state. |
|
109 |
* |
|
110 |
* @param mappings NamespaceMappings |
|
111 |
*/ |
|
112 |
public void setNamespaceMappings(NamespaceMappings mappings); |
|
113 |
||
114 |
/** |
|
25834
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
115 |
* A SerializationHandler accepts SAX-like events, so |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
116 |
* it can accumulate attributes or namespace nodes after |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
117 |
* a startElement(). |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
118 |
* <p> |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
119 |
* If the SerializationHandler has a Writer or OutputStream, |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
120 |
* a call to this method will flush such accumulated |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
121 |
* events as a closed start tag for an element. |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
122 |
* <p> |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
123 |
* If the SerializationHandler wraps a ContentHandler, |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
124 |
* a call to this method will flush such accumulated |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
125 |
* events as a SAX (not SAX-like) calls to |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
126 |
* startPrefixMapping() and startElement(). |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
127 |
* <p> |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
128 |
* If one calls endDocument() then one need not call |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
129 |
* this method since a call to endDocument() will |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
130 |
* do what this method does. However, in some |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
131 |
* circumstances, such as with document fragments, |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
132 |
* endDocument() is not called and it may be |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
133 |
* necessary to call this method to flush |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
134 |
* any pending events. |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
135 |
* <p> |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
136 |
* For performance reasons this method should not be called |
aba3efbf4ec5
8035467: Xerces Update: Move to Xalan based DOM L3 serializer. Deprecate Xerces' native serializer.
joehw
parents:
12458
diff
changeset
|
137 |
* very often. |
6 | 138 |
*/ |
139 |
public void flushPending() throws SAXException; |
|
140 |
||
141 |
/** |
|
142 |
* Default behavior is to expand DTD entities, |
|
143 |
* that is the initall default value is true. |
|
144 |
* @param expand true if DTD entities are to be expanded, |
|
145 |
* false if they are to be left as DTD entity references. |
|
146 |
*/ |
|
147 |
public void setDTDEntityExpansion(boolean expand); |
|
148 |
||
12458 | 149 |
/** |
150 |
* Specify if the output will be treated as a standalone property |
|
151 |
* @param isStandalone true if the http://www.oracle.com/xml/is-standalone is set to yes |
|
152 |
* @see OutputPropertiesFactory ORACLE_IS_STANDALONE |
|
153 |
*/ |
|
154 |
public void setIsStandalone(boolean b); |
|
6 | 155 |
|
156 |
} |