Dead
[official-gcc.git] / gomp-20050608-branch / libjava / classpath / javax / xml / stream / XMLStreamWriter.java
blob5fe9e9f70f4e53d5935ad42071c096408e120418
1 /* XMLStreamWriter.java --
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 package javax.xml.stream;
40 import javax.xml.namespace.NamespaceContext;
42 /**
43 * Interface for writing XML to a stream.
45 public interface XMLStreamWriter
48 /**
49 * Write the start of a tag.
51 void writeStartElement(String localName)
52 throws XMLStreamException;
54 /**
55 * Write the start of a tag.
57 void writeStartElement(String namespaceURI, String localName)
58 throws XMLStreamException;
60 /**
61 * Write the start of a tag.
63 void writeStartElement(String prefix, String localName, String namespaceURI)
64 throws XMLStreamException;
66 /**
67 * Write an empty tag.
69 void writeEmptyElement(String namespaceURI, String localName)
70 throws XMLStreamException;
72 /**
73 * Write an empty tag.
75 void writeEmptyElement(String prefix, String localName, String namespaceURI)
76 throws XMLStreamException;
78 /**
79 * Write an empty tag.
81 void writeEmptyElement(String localName)
82 throws XMLStreamException;
84 /**
85 * Closes the currently open tag.
87 void writeEndElement()
88 throws XMLStreamException;
90 /**
91 * Closes any currently open tags.
93 void writeEndDocument()
94 throws XMLStreamException;
96 /**
97 * Frees any resources used by this writer.
98 * This will not close the underlying output sink.
100 void close()
101 throws XMLStreamException;
104 * Flushes any cached information to the underlying output sink.
106 void flush()
107 throws XMLStreamException;
110 * Write an attribute.
112 void writeAttribute(String localName, String value)
113 throws XMLStreamException;
116 * Write an attribute.
118 void writeAttribute(String prefix, String namespaceURI,
119 String localName, String value)
120 throws XMLStreamException;
123 * Write an attribute.
125 void writeAttribute(String namespaceURI, String localName, String value)
126 throws XMLStreamException;
129 * Write a namespace declaration.
131 void writeNamespace(String prefix, String namespaceURI)
132 throws XMLStreamException;
135 * Write a default namespace declaration.
137 void writeDefaultNamespace(String namespaceURI)
138 throws XMLStreamException;
141 * Write a comment.
143 void writeComment(String data)
144 throws XMLStreamException;
147 * Write a processing instruction.
149 void writeProcessingInstruction(String target)
150 throws XMLStreamException;
153 * Write a processing instruction.
155 void writeProcessingInstruction(String target, String data)
156 throws XMLStreamException;
159 * Write a CDATA section.
161 void writeCData(String data)
162 throws XMLStreamException;
165 * Write a DOCTYPE declaration.
167 void writeDTD(String dtd)
168 throws XMLStreamException;
171 * Write an entity reference.
173 void writeEntityRef(String name)
174 throws XMLStreamException;
177 * Write an XML declaration.
179 void writeStartDocument()
180 throws XMLStreamException;
183 * Write an XML declaration with the specified XML version.
185 void writeStartDocument(String version)
186 throws XMLStreamException;
189 * Write an XML declaration with the specifed XML version and encoding.
191 void writeStartDocument(String encoding, String version)
192 throws XMLStreamException;
195 * Write the specified text.
197 void writeCharacters(String text)
198 throws XMLStreamException;
201 * Write the specified text.
203 void writeCharacters(char[] text, int start, int len)
204 throws XMLStreamException;
207 * Returns the prefix associated with the given namespace URI.
209 String getPrefix(String uri)
210 throws XMLStreamException;
213 * Sets the prefix for the given namespace URI.
215 void setPrefix(String prefix, String uri)
216 throws XMLStreamException;
219 * Sets the URI for the default namespace.
221 void setDefaultNamespace(String uri)
222 throws XMLStreamException;
225 * Sets the namespace context for namespace resolution.
227 void setNamespaceContext(NamespaceContext context)
228 throws XMLStreamException;
231 * Returns the current namespace context.
233 NamespaceContext getNamespaceContext();
236 * Returns the implementation-specific feature or property of the given
237 * name.
238 * @exception IllegalArgumentException if the property is not supported
240 Object getProperty(String name)
241 throws IllegalArgumentException;