XMLStreamWriter interface.
Note that the implementation is only to be used for use with
javax.xml.transform.dom.DOMResult.
Some notes regarding missing/incomplete functionality:
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected int[] | _autoNsSeq
for NsRepairing mode |
| protected final WriterConfig | |
| protected DOMOutputElement | _currElem
This element is the current context element, under which all other nodes are added, until matching end element is output. |
| protected DOMOutputElement | _openElement
This element is non-null right after a call to
either |
| protected String | |
| pack-priv HashMap | _suggestedPrefixes
Map that contains URI-to-prefix entries that point out suggested prefixes for URIs. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public static DOMWriterImpl | |
| protected void | createStartElem(String
Namespace URI to use: null and empty String denote 'no namespace' nsURI, String prefix, String localName, boolean isEmpty)Method called by all start element write methods. |
| protected final String | findElemPrefix(String
URI of namespace for which we need a prefix nsURI, DOMOutputElement elem)Method called to find an existing prefix for the given namespace, if any exists in the scope. |
| protected final String | findOrCreateAttrPrefix(String
Suggested prefix to bind, if any; may be null
to indicate "no preference" suggPrefix, String URI of namespace for which we need a prefix nsURI, DOMOutputElement Currently open start element, on which the attribute
will be added. elem)Method called to somehow find a prefix for given namespace, to be used for a new start element; either use an existing one, or generate a new one. |
| protected final String | generateElemPrefix(String suggPrefix, String nsURI, DOMOutputElement elem)
Method called after |
| public NamespaceContext | getNamespaceContext()
Implements abstract org. Implements javax. |
| public String | getPrefix(String
the uri the prefix is bound to uri)Implements abstract org. Implements javax. |
| public Object | getProperty(String
The name of the property, may not be null name)Implements abstract org. Implements javax. |
| public boolean | isPropertySupported(String name)
Implements abstract org. Implements org. javax., used
to determine whether a property is supported by the Writer
instance.
|
| protected void | |
| public void | setDefaultNamespace(String
the uri to bind to the default namespace, may be null uri)Implements abstract org. Implements javax. |
| public void | setPrefix(String
the prefix to bind to the uri, may not be null prefix, String the uri to bind to the prefix, may be null uri)Implements abstract org. Implements javax. |
| public boolean | setProperty(String
Name of the property to set name, Object Value to set property to. value)Implements abstract org. Implements org. org.
instance.
|
| private final String | |
| public void | writeAttribute(String
the local name of the attribute localName, String the value of the attribute value)Implements abstract org. Implements javax. |
| public void | writeAttribute(String
the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Implements abstract org. Implements javax. |
| public void | writeAttribute(String
the prefix for this attribute prefix, String the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Implements abstract org. Implements javax. |
| public void | writeDefaultNamespace(String
the uri to bind the default namespace to nsURI)Implements abstract org. Implements javax. |
| public void | writeDTD(String rootName, String systemId, String publicId, String internalSubset)
Implements abstract org. Implements org. |
| public void | writeEmptyElement(String
local name of the tag, may not be null localName)Implements abstract org. Implements javax. |
| public void | writeEmptyElement(String
the uri to bind the tag to, may not be null nsURI, String local name of the tag, may not be null localName)Implements abstract org. Implements javax. |
| public void | writeEmptyElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the tag to, may not be null nsURI)Implements abstract org. Implements javax. |
| public void | writeEndDocument()
Implements abstract org. Implements javax. |
| public void | writeEndElement()
Implements javax. |
| public void | writeNamespace(String
the prefix to bind this namespace to prefix, String the uri to bind the prefix to nsURI)Implements javax. |
| public void | writeStartElement(String
local name of the tag, may not be null localName)Implements javax. |
| public void | writeStartElement(String
the namespaceURI of the prefix to use, may not be null nsURI, String local name of the tag, may not be null localName)Implements javax. |
| public void | writeStartElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the prefix to, may not be null nsURI)Implements javax. |
| _automaticNsPrefix | back to summary |
|---|---|
| protected String _automaticNsPrefix | |
| _autoNsSeq | back to summary |
|---|---|
| protected int[] _autoNsSeq for NsRepairing mode | |
| _config | back to summary |
|---|---|
| protected final WriterConfig _config | |
| _currElem | back to summary |
|---|---|
| protected DOMOutputElement _currElem This element is the current context element, under which all other nodes are added, until matching end element is output. Null outside of the main element tree. Note explicit empty element (written using
| |
| _openElement | back to summary |
|---|---|
| protected DOMOutputElement _openElement This element is non-null right after a call to
either Note while this is often the same as | |
| _suggestedDefNs | back to summary |
|---|---|
| protected String _suggestedDefNs | |
| _suggestedPrefixes | back to summary |
|---|---|
| pack-priv HashMap<String, String> _suggestedPrefixes Map that contains URI-to-prefix entries that point out suggested
prefixes for URIs. These are populated by calls to
| |
| DOMWriterImpl | back to summary |
|---|---|
| private DOMWriterImpl(WriterConfig cfg, Node treeRoot) throws XMLStreamException | |
| appendLeaf | back to summary |
|---|---|
| protected void appendLeaf(Node n) throws IllegalStateException Implements abstract org.
| |
| createFrom | back to summary |
|---|---|
| public static DOMWriterImpl createFrom(WriterConfig cfg, DOMResult dst) throws XMLStreamException | |
| createStartElem | back to summary |
|---|---|
| protected void createStartElem(String nsURI, String prefix, String localName, boolean isEmpty) throws XMLStreamException Method called by all start element write methods.
| |
| findElemPrefix | back to summary |
|---|---|
| protected final String findElemPrefix(String nsURI, DOMOutputElement elem) throws XMLStreamException Method called to find an existing prefix for the given namespace, if any exists in the scope. If one is found, it's returned (including "" for the current default namespace); if not, null is returned.
| |
| findOrCreateAttrPrefix | back to summary |
|---|---|
| protected final String findOrCreateAttrPrefix(String suggPrefix, String nsURI, DOMOutputElement elem) throws XMLStreamException Method called to somehow find a prefix for given namespace, to be used for a new start element; either use an existing one, or generate a new one. If a new mapping needs to be generated, it will also be automatically bound, and necessary namespace declaration output.
| |
| generateElemPrefix | back to summary |
|---|---|
| protected final String generateElemPrefix(String suggPrefix, String nsURI, DOMOutputElement elem) throws XMLStreamException Method called after | |
| getNamespaceContext | back to summary |
|---|---|
| public NamespaceContext getNamespaceContext() Implements abstract org. Implements javax. Doc from javax. Returns the current namespace context.
| |
| getPrefix | back to summary |
|---|---|
| public String getPrefix(String uri) Implements abstract org. Implements javax. Doc from javax. Gets the prefix the uri is bound to. | |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) Implements abstract org. Implements javax. Doc from javax. Get the value of a feature/property from the underlying implementation | |
| isPropertySupported | back to summary |
|---|---|
| public boolean isPropertySupported(String name) Implements abstract org. Implements org. Doc from org. Method similar to
| |
| outputAttribute | back to summary |
|---|---|
| protected void outputAttribute(String nsURI, String prefix, String localName, String value) throws XMLStreamException | |
| setDefaultNamespace | back to summary |
|---|---|
| public void setDefaultNamespace(String uri) Implements abstract org. Implements javax. Doc from javax. Binds a URI to the default namespace This URI is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the uri is bound in the root scope. | |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(String prefix, String uri) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Sets the prefix the uri is bound to. This prefix is bound in the scope of the current START_ELEMENT / END_ELEMENT pair. If this method is called before a START_ELEMENT has been written the prefix is bound in the root scope.
| |
| setProperty | back to summary |
|---|---|
| public boolean setProperty(String name, Object value) Implements abstract org. Implements org. Doc from org. Method that can be used to set per-writer properties; a subset of
properties one can set via matching
| |
| validateElemPrefix | back to summary |
|---|---|
| private final String validateElemPrefix(String prefix, String nsURI, DOMOutputElement elem) throws XMLStreamException | |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String localName, String value) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an attribute to the output stream without a prefix.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an attribute to the output stream
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an attribute to the output stream
| |
| writeDefaultNamespace | back to summary |
|---|---|
| public void writeDefaultNamespace(String nsURI) Implements abstract org. Implements javax. Doc from javax. Writes the default namespace to the stream | |
| writeDTD | back to summary |
|---|---|
| public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException Implements abstract org. Implements org.
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String localName) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String nsURI, String localName) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements abstract org. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEndDocument | back to summary |
|---|---|
| public void writeEndDocument() Implements abstract org. Implements javax. Doc from javax. Closes any start tags and writes corresponding end tags.
| |
| writeEndElement | back to summary |
|---|---|
| public void writeEndElement() Implements javax. Doc from javax. Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.
| |
| writeNamespace | back to summary |
|---|---|
| public void writeNamespace(String prefix, String nsURI) throws XMLStreamException Implements javax. Doc from javax. Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String localName) throws XMLStreamException Implements javax. Doc from javax. Writes a start tag to the output. All writeStartElement methods open a new scope in the internal namespace context. Writing the corresponding EndElement causes the scope to be closed.
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String nsURI, String localName) throws XMLStreamException Implements javax. Doc from javax. Writes a start tag to the output
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements javax. Doc from javax. Writes a start tag to the output
| |