1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.commons.xmlio.out;
25
26 import java.io.IOException;
27 import java.io.StringWriter;
28
29
30
31
32
33
34
35
36
37 public class XMLStringWriter extends XMLWriter {
38
39
40 public static XMLStringWriter create() {
41 return new XMLStringWriter(new StringWriter());
42 }
43
44 private StringWriter sw;
45
46 private XMLStringWriter(StringWriter sw) {
47 super(sw);
48 this.sw = sw;
49 }
50
51
52 public String toString() {
53 try {
54 flush();
55 } catch (IOException ioe) {
56
57 }
58 sw.flush();
59 return sw.toString();
60 }
61
62 public void writeXMLDeclaration() {
63 try {
64 super.writeXMLDeclaration();
65 } catch (IOException ioe) {
66
67 }
68 }
69
70 public void writeProlog(String prolog) {
71 try {
72 super.writeProlog(prolog);
73 } catch (IOException ioe) {
74
75 }
76 }
77
78 public void writeNl() {
79 try {
80 super.writeNl();
81 } catch (IOException ioe) {
82
83 }
84 }
85
86 public void writeComment(String comment) {
87 try {
88 super.writeComment(comment);
89 } catch (IOException ioe) {
90
91 }
92 }
93
94 public void writePI(String target, String data) {
95 try {
96 super.writePI(target, data);
97 } catch (IOException ioe) {
98
99 }
100 }
101
102 public void writeStartTag(String startTag, boolean nl) {
103 try {
104 super.writeStartTag(startTag, nl);
105 } catch (IOException ioe) {
106
107 }
108 }
109
110 public void writeStartTag(String startTag) {
111 try {
112 super.writeStartTag(startTag);
113 } catch (IOException ioe) {
114
115 }
116 }
117
118 public void writeEndTag(String endTag, boolean nl) {
119 try {
120 super.writeEndTag(endTag, nl);
121 } catch (IOException ioe) {
122
123 }
124 }
125
126 public void writeEndTag(String endTag) {
127 try {
128 super.writeEndTag(endTag);
129 } catch (IOException ioe) {
130
131 }
132 }
133
134 public void writeEmptyElement(String emptyTag, boolean nl) {
135 try {
136 super.writeEmptyElement(emptyTag, nl);
137 } catch (IOException ioe) {
138
139 }
140 }
141
142 public void writeEmptyElement(String emptyTag) {
143 try {
144 super.writeEmptyElement(emptyTag);
145 } catch (IOException ioe) {
146
147 }
148 }
149
150 public void writeCData(String cData) {
151 try {
152 super.writeCData(cData);
153 } catch (IOException ioe) {
154
155 }
156 }
157
158 public void writePCData(String pcData) {
159 try {
160 super.writePCData(pcData);
161 } catch (IOException ioe) {
162
163 }
164 }
165
166 public void writeElementWithCData(String startTag, String cData, String endTag) {
167 try {
168 super.writeElementWithCData(startTag, cData, endTag);
169 } catch (IOException ioe) {
170
171 }
172 }
173
174 public void writeElementWithPCData(String startTag, String pcData, String endTag) {
175 try {
176 super.writeElementWithPCData(startTag, pcData, endTag);
177 } catch (IOException ioe) {
178
179 }
180 }
181
182 }