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, writeStartDocumentprotected 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
XMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWritergetNamespaceContext in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic String getPrefix(String uri)
getPrefix in interface XMLStreamWritergetPrefix in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic Object getProperty(String name)
getProperty in interface XMLStreamWritergetProperty in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic void setDefaultNamespace(String uri)
setDefaultNamespace in interface XMLStreamWritersetDefaultNamespace in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix in interface XMLStreamWritersetPrefix in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeAttribute(String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterwriteAttribute in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterwriteAttribute in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterwriteAttribute in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeDefaultNamespace(String nsURI)
writeDefaultNamespace in interface XMLStreamWriterwriteDefaultNamespace in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeEmptyElement(String nsURI, String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionpublic void writeEndDocument()
writeEndDocument in interface XMLStreamWriterwriteEndDocument in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic void writeEndElement()
public void writeNamespace(String prefix, String nsURI) throws XMLStreamException
XMLStreamExceptionpublic void writeStartElement(String localName) throws XMLStreamException
XMLStreamExceptionpublic void writeStartElement(String nsURI, String localName) throws XMLStreamException
XMLStreamExceptionpublic void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException
XMLStreamExceptionpublic boolean isPropertySupported(String name)
isPropertySupported in interface org.codehaus.stax2.XMLStreamWriter2isPropertySupported in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic boolean setProperty(String name, Object value)
setProperty in interface org.codehaus.stax2.XMLStreamWriter2setProperty in class org.codehaus.stax2.ri.dom.DOMWrappingWriterpublic void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException
writeDTD in interface org.codehaus.stax2.XMLStreamWriter2writeDTD in class org.codehaus.stax2.ri.dom.DOMWrappingWriterXMLStreamExceptionprotected void appendLeaf(Node n) throws IllegalStateException
appendLeaf in class org.codehaus.stax2.ri.dom.DOMWrappingWriterIllegalStateExceptionprotected void createStartElem(String nsURI, String prefix, String localName, boolean isEmpty) throws XMLStreamException
nsURI - Namespace URI to use: null and empty String denote 'no namespace'XMLStreamExceptionprotected void outputAttribute(String nsURI, String prefix, String localName, String value) throws XMLStreamException
XMLStreamExceptionprotected final String findElemPrefix(String nsURI, DOMOutputElement elem) throws XMLStreamException
nsURI - URI of namespace for which we need a prefixXMLStreamExceptionprotected 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.XMLStreamExceptionprotected 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.XMLStreamExceptionCopyright © 2018 FasterXML. All rights reserved.