public class WstxDOMWrappingWriter
extends org.codehaus.stax2.ri.dom.DOMWrappingWriter
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 static String |
ERR_NSDECL_WRONG_STATE |
protected String |
mAutomaticNsPrefix |
protected int[] |
mAutoNsSeq
for NsRepairing mode
|
protected WriterConfig |
mConfig |
protected DOMOutputElement |
mCurrElem
This element is the current context element, under which
all other nodes are added, until matching end element
is output.
|
protected DOMOutputElement |
mOpenElement
This element is non-null right after a call to
either
writeStartElement and
writeEmptyElement , and can be used to
add attributes and namespace declarations. |
protected String |
mSuggestedDefNs |
Modifier and Type | Method and Description |
---|---|
protected void |
appendLeaf(Node n) |
static WstxDOMWrappingWriter |
createFrom(WriterConfig cfg,
DOMResult dst) |
protected void |
createStartElem(String nsURI,
String prefix,
String localName,
boolean isEmpty)
Method called by all start element write methods.
|
protected String |
findElemPrefix(String nsURI,
DOMOutputElement elem)
Method called to find an existing prefix for the given namespace,
if any exists in the scope.
|
protected String |
findOrCreateAttrPrefix(String suggPrefix,
String nsURI,
DOMOutputElement 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 String |
generateElemPrefix(String suggPrefix,
String nsURI,
DOMOutputElement elem)
Method called after
findElemPrefix(java.lang.String, com.ctc.wstx.dom.DOMOutputElement) has returned null,
to create and bind a namespace mapping for specified namespace. |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String uri) |
Object |
getProperty(String name) |
boolean |
isPropertySupported(String name) |
protected void |
outputAttribute(String nsURI,
String prefix,
String localName,
String value) |
void |
setDefaultNamespace(String uri) |
void |
setPrefix(String prefix,
String uri) |
boolean |
setProperty(String name,
Object value) |
void |
writeAttribute(String localName,
String value) |
void |
writeAttribute(String nsURI,
String localName,
String value) |
void |
writeAttribute(String prefix,
String nsURI,
String localName,
String value) |
void |
writeDefaultNamespace(String nsURI) |
void |
writeDTD(String rootName,
String systemId,
String publicId,
String internalSubset) |
void |
writeEmptyElement(String localName) |
void |
writeEmptyElement(String nsURI,
String localName) |
void |
writeEmptyElement(String prefix,
String localName,
String nsURI) |
void |
writeEndDocument() |
void |
writeEndElement() |
void |
writeNamespace(String prefix,
String nsURI) |
void |
writeStartElement(String localName) |
void |
writeStartElement(String nsURI,
String localName) |
void |
writeStartElement(String prefix,
String localName,
String nsURI) |
close, closeCompletely, copyEventFromReader, flush, getEncoding, getLocation, getValueEncoder, reportUnsupported, serializeQNameValue, setNamespaceContext, setValidationProblemHandler, stopValidatingAgainst, stopValidatingAgainst, throwOutputError, throwOutputError, validateAgainst, writeBinary, writeBinary, writeBinaryAttribute, writeBinaryAttribute, writeBoolean, writeBooleanAttribute, writeCData, writeCData, writeCharacters, writeCharacters, writeComment, writeDecimal, writeDecimalAttribute, writeDouble, writeDoubleArray, writeDoubleArrayAttribute, writeDoubleAttribute, writeDTD, writeEntityRef, writeFloat, writeFloatArray, writeFloatArrayAttribute, writeFloatAttribute, writeFullEndElement, writeInt, writeIntArray, writeIntArrayAttribute, writeIntAttribute, writeInteger, writeIntegerAttribute, writeLong, writeLongArray, writeLongArrayAttribute, writeLongAttribute, writeProcessingInstruction, writeProcessingInstruction, writeQName, writeQNameAttribute, writeRaw, writeRaw, writeRaw, writeSpace, writeSpace, writeStartDocument, writeStartDocument, writeStartDocument, writeStartDocument
protected static final String ERR_NSDECL_WRONG_STATE
protected final WriterConfig mConfig
protected DOMOutputElement mCurrElem
Note: explicit empty element (written using
writeEmptyElement
) will never become
current element.
protected DOMOutputElement mOpenElement
writeStartElement
and
writeEmptyElement
, and can be used to
add attributes and namespace declarations.
Note: while this is often the same as mCurrElem
,
it's not always. Specifically, an empty element (written
explicitly using writeEmptyElement
) will
become open element but NOT current element. Conversely,
regular elements will remain current element when
non elements are written (text, comments, PI), but
not the open element.
protected int[] mAutoNsSeq
protected String mSuggestedDefNs
protected String mAutomaticNsPrefix
public static WstxDOMWrappingWriter createFrom(WriterConfig cfg, DOMResult dst) throws XMLStreamException
XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamWriter
getNamespaceContext
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public String getPrefix(String uri)
getPrefix
in interface XMLStreamWriter
getPrefix
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public Object getProperty(String name)
getProperty
in interface XMLStreamWriter
getProperty
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public void setDefaultNamespace(String uri)
setDefaultNamespace
in interface XMLStreamWriter
setDefaultNamespace
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix
in interface XMLStreamWriter
setPrefix
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeAttribute(String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
writeAttribute
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
writeAttribute
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
writeAttribute
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeDefaultNamespace(String nsURI)
writeDefaultNamespace
in interface XMLStreamWriter
writeDefaultNamespace
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
writeEmptyElement
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeEmptyElement(String nsURI, String localName) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
writeEmptyElement
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
writeEmptyElement
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
public void writeEndDocument()
writeEndDocument
in interface XMLStreamWriter
writeEndDocument
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public void writeEndElement()
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException
XMLStreamException
public void writeStartElement(String localName) throws XMLStreamException
XMLStreamException
public void writeStartElement(String nsURI, String localName) throws XMLStreamException
XMLStreamException
public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException
XMLStreamException
public boolean isPropertySupported(String name)
isPropertySupported
in interface org.codehaus.stax2.XMLStreamWriter2
isPropertySupported
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public boolean setProperty(String name, Object value)
setProperty
in interface org.codehaus.stax2.XMLStreamWriter2
setProperty
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException
writeDTD
in interface org.codehaus.stax2.XMLStreamWriter2
writeDTD
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
XMLStreamException
protected void appendLeaf(Node n) throws IllegalStateException
appendLeaf
in class org.codehaus.stax2.ri.dom.DOMWrappingWriter
IllegalStateException
protected void createStartElem(String nsURI, String prefix, String localName, boolean isEmpty) throws XMLStreamException
nsURI
- Namespace URI to use: null and empty String denote 'no namespace'XMLStreamException
protected void outputAttribute(String nsURI, String prefix, String localName, String value) throws XMLStreamException
XMLStreamException
protected final String findElemPrefix(String nsURI, DOMOutputElement elem) throws XMLStreamException
nsURI
- URI of namespace for which we need a prefixXMLStreamException
protected final String generateElemPrefix(String suggPrefix, String nsURI, DOMOutputElement elem) throws XMLStreamException
findElemPrefix(java.lang.String, com.ctc.wstx.dom.DOMOutputElement)
has returned null,
to create and bind a namespace mapping for specified namespace.XMLStreamException
protected final String findOrCreateAttrPrefix(String suggPrefix, String nsURI, DOMOutputElement elem) throws XMLStreamException
suggPrefix
- Suggested prefix to bind, if any; may be null
to indicate "no preference"nsURI
- URI of namespace for which we need a prefixelem
- Currently open start element, on which the attribute
will be added.XMLStreamException
Copyright © 2018 FasterXML. All rights reserved.