Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.xml.stream.XMLStreamWriterImpl
Field Summary | |
protected String |
|
protected NamespaceContext |
|
protected boolean |
|
protected Writer |
|
Constructor Summary | |
|
Method Summary | |
void |
|
protected String |
|
void |
|
NamespaceContext |
|
String | |
Object |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected final String encoding
The encoding being used. Note that this must match the encoding of the character stream.
protected NamespaceContext namespaceContext
The namespace context used to determine the namespace-prefix mappings in scope.
protected final boolean prefixDefaulting
Whether prefix defaulting is being used. If true and a prefix has not been defined for a namespace specified on an element or an attribute, a new prefix and namespace declaration will be created.
protected XMLStreamWriterImpl(Writer writer, String encoding, boolean prefixDefaulting)
Constructor.
- See Also:
writer
,encoding
,prefixDefaulting
public void close() throws XMLStreamException
Frees any resources used by this writer. This will not close the underlying output sink.
- Specified by:
- close in interface XMLStreamWriter
protected String createPrefix(String namespaceURI)
Creates a new unique prefix in the document. Subclasses may override this method to provide a suitably unique prefix for the given namespace.
- Parameters:
namespaceURI
- the namespace URI
public void flush() throws XMLStreamException
Flushes any cached information to the underlying output sink.
- Specified by:
- flush in interface XMLStreamWriter
public NamespaceContext getNamespaceContext()
Returns the current namespace context.
- Specified by:
- getNamespaceContext in interface XMLStreamWriter
public String getPrefix(String uri) throws XMLStreamException
Returns the prefix associated with the given namespace URI.
- Specified by:
- getPrefix in interface XMLStreamWriter
public Object getProperty(String name) throws IllegalArgumentException
Returns the implementation-specific feature or property of the given name.
- Specified by:
- getProperty in interface XMLStreamWriter
- Throws:
IllegalArgumentException
- if the property is not supported
public void setDefaultNamespace(String uri) throws XMLStreamException
Sets the URI for the default namespace.
- Specified by:
- setDefaultNamespace in interface XMLStreamWriter
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException
Sets the namespace context for namespace resolution.
- Specified by:
- setNamespaceContext in interface XMLStreamWriter
public void setPrefix(String prefix, String uri) throws XMLStreamException
Sets the prefix for the given namespace URI.
- Specified by:
- setPrefix in interface XMLStreamWriter
public void writeAttribute(String localName, String value) throws XMLStreamException
Write an attribute.
- Specified by:
- writeAttribute in interface XMLStreamWriter
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
Write an attribute.
- Specified by:
- writeAttribute in interface XMLStreamWriter
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
Write an attribute.
- Specified by:
- writeAttribute in interface XMLStreamWriter
public void writeCData(String data) throws XMLStreamException
Write a CDATA section.
- Specified by:
- writeCData in interface XMLStreamWriter
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException
Write the specified text.
- Specified by:
- writeCharacters in interface XMLStreamWriter
public void writeCharacters(String text) throws XMLStreamException
Write the specified text.
- Specified by:
- writeCharacters in interface XMLStreamWriter
public void writeComment(String data) throws XMLStreamException
Write a comment.
- Specified by:
- writeComment in interface XMLStreamWriter
public void writeDTD(String dtd) throws XMLStreamException
Write a DOCTYPE declaration.
- Specified by:
- writeDTD in interface XMLStreamWriter
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
Write a default namespace declaration.
- Specified by:
- writeDefaultNamespace in interface XMLStreamWriter
public void writeEmptyElement(String localName) throws XMLStreamException
Write an empty tag.
- Specified by:
- writeEmptyElement in interface XMLStreamWriter
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
Write an empty tag.
- Specified by:
- writeEmptyElement in interface XMLStreamWriter
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
Write an empty tag.
- Specified by:
- writeEmptyElement in interface XMLStreamWriter
public void writeEndDocument() throws XMLStreamException
Closes any currently open tags.
- Specified by:
- writeEndDocument in interface XMLStreamWriter
public void writeEndElement() throws XMLStreamException
Closes the currently open tag.
- Specified by:
- writeEndElement in interface XMLStreamWriter
public void writeEntityRef(String name) throws XMLStreamException
Write an entity reference.
- Specified by:
- writeEntityRef in interface XMLStreamWriter
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
Write a namespace declaration.
- Specified by:
- writeNamespace in interface XMLStreamWriter
public void writeProcessingInstruction(String target) throws XMLStreamException
Write a processing instruction.
- Specified by:
- writeProcessingInstruction in interface XMLStreamWriter
public void writeProcessingInstruction(String target, String data) throws XMLStreamException
Write a processing instruction.
- Specified by:
- writeProcessingInstruction in interface XMLStreamWriter
public void writeStartDocument() throws XMLStreamException
Write an XML declaration.
- Specified by:
- writeStartDocument in interface XMLStreamWriter
public void writeStartDocument(String version) throws XMLStreamException
Write an XML declaration with the specified XML version.
- Specified by:
- writeStartDocument in interface XMLStreamWriter
public void writeStartDocument(String encoding, String version) throws XMLStreamException
Write an XML declaration with the specifed XML version and encoding.
- Specified by:
- writeStartDocument in interface XMLStreamWriter
public void writeStartElement(String localName) throws XMLStreamException
Write the start of a tag.
- Specified by:
- writeStartElement in interface XMLStreamWriter
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
Write the start of a tag.
- Specified by:
- writeStartElement in interface XMLStreamWriter
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
Write the start of a tag.
- Specified by:
- writeStartElement in interface XMLStreamWriter