public final class FormattingXMLStreamWriter extends Object implements XMLExtendedStreamWriter, XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
FormattingXMLStreamWriter(XMLStreamWriter delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String uri) |
Object |
getProperty(String name) |
void |
setDefaultNamespace(String uri) |
void |
setNamespaceContext(NamespaceContext context) |
void |
setPrefix(String prefix,
String uri) |
void |
setUnspecifiedElementNamespace(String namespace)
Sets the namespace to use for child element writes when a namespace is not specified.
|
void |
writeAttribute(String localName,
Iterable<String> values) |
void |
writeAttribute(String localName,
String value) |
void |
writeAttribute(String localName,
String[] values) |
void |
writeAttribute(String namespaceURI,
String localName,
Iterable<String> values) |
void |
writeAttribute(String namespaceURI,
String localName,
String value) |
void |
writeAttribute(String namespaceURI,
String localName,
String[] values) |
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
Iterable<String> values) |
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
String value) |
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
String[] values) |
void |
writeCData(String data) |
void |
writeCharacters(char[] text,
int start,
int len) |
void |
writeCharacters(String text) |
void |
writeComment(String data) |
void |
writeDefaultNamespace(String namespaceURI) |
void |
writeDTD(String dtd) |
void |
writeEmptyElement(String localName) |
void |
writeEmptyElement(String namespaceURI,
String localName) |
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI) |
void |
writeEndDocument() |
void |
writeEndElement() |
void |
writeEntityRef(String name) |
void |
writeNamespace(String prefix,
String namespaceURI) |
void |
writeProcessingInstruction(String target) |
void |
writeProcessingInstruction(String target,
String data) |
void |
writeStartDocument() |
void |
writeStartDocument(String version) |
void |
writeStartDocument(String encoding,
String version) |
void |
writeStartElement(String localName) |
void |
writeStartElement(String namespaceURI,
String localName) |
void |
writeStartElement(String prefix,
String localName,
String namespaceURI) |
public FormattingXMLStreamWriter(XMLStreamWriter delegate)
public void setUnspecifiedElementNamespace(String namespace)
XMLExtendedStreamWriter
XMLStreamWriter.writeStartElement(String)
is called this namespace
will be used. Setting this to null will result in the standard behavior, which is
usage of the xml default ns (not specifying a prefix)
This setting is scoped within the document or element that it was called in. Once
called all further child elements will use this namespace. In addition, it is
inherited for all levels of nesting. In other words, setting an unspecified namespace
on a grandchild will not affect the namespace setting of a child sibling.
To clear the effect of this setting, call the method with a value of null.setUnspecifiedElementNamespace
in interface XMLExtendedStreamWriter
namespace
- The namespace to use when not specified on elements, or null
if the xml default ns should be usedpublic void writeStartElement(String localName) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndElement() throws XMLStreamException
writeEndElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndDocument() throws XMLStreamException
writeEndDocument
in interface XMLStreamWriter
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLStreamWriter
XMLStreamException
public void flush() throws XMLStreamException
flush
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String localName, String[] values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeAttribute(String prefix, String namespaceURI, String localName, String[] values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeAttribute(String namespaceURI, String localName, String[] values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeAttribute(String localName, Iterable<String> values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeAttribute(String prefix, String namespaceURI, String localName, Iterable<String> values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeAttribute(String namespaceURI, String localName, Iterable<String> values) throws XMLStreamException
writeAttribute
in interface XMLExtendedStreamWriter
XMLStreamException
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
writeNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
writeDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeComment(String data) throws XMLStreamException
writeComment
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String target) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String target, String data) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeCData(String data) throws XMLStreamException
writeCData
in interface XMLStreamWriter
XMLStreamException
public void writeDTD(String dtd) throws XMLStreamException
writeDTD
in interface XMLStreamWriter
XMLStreamException
public void writeEntityRef(String name) throws XMLStreamException
writeEntityRef
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument() throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String version) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String encoding, String version) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(String text) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public String getPrefix(String uri) throws XMLStreamException
getPrefix
in interface XMLStreamWriter
XMLStreamException
public void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix
in interface XMLStreamWriter
XMLStreamException
public void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext
in interface XMLStreamWriter
XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamWriter
public Object getProperty(String name) throws IllegalArgumentException
getProperty
in interface XMLStreamWriter
IllegalArgumentException
Copyright © 2023 JBoss by Red Hat. All rights reserved.