public final class SimpleOutputElement extends OutputElementBase
One noteworthy feature of the class is that it is designed to allow "short-term recycling", ie. instances can be reused within context of a simple document output. While reuse/recycling of such lightweight object is often useless or even counter productive, here it may be worth using, due to simplicity of the scheme (basically using a very simple free-elements linked list).
Modifier and Type | Field and Description |
---|---|
protected HashSet<com.ctc.wstx.sw.SimpleOutputElement.AttrName> |
mAttrSet
Map used to check for duplicate attribute declarations, if
feature is enabled.
|
protected String |
mLocalName
Local name of the element.
|
protected SimpleOutputElement |
mParent
Reference to the parent element, element enclosing this element.
|
protected String |
mPrefix
Prefix that is used for the element.
|
protected String |
mURI
Namespace of the element, whatever
mPrefix maps to. |
mDefaultNsURI, mNsMapping, mNsMapShared, mRootNsContext, PREFIX_MISBOUND, PREFIX_OK, PREFIX_UNBOUND
Modifier and Type | Method and Description |
---|---|
protected void |
addToPool(SimpleOutputElement poolHead)
Method called to temporarily link this instance to a pool, to
allow reusing of instances with the same reader.
|
void |
checkAttrWrite(String nsURI,
String localName) |
protected SimpleOutputElement |
createChild(String localName)
Simplest factory method, which gets called when a 1-argument
element output method is called.
|
protected SimpleOutputElement |
createChild(String prefix,
String localName,
String uri)
Full factory method, used for 'normal' namespace qualified output
methods.
|
static SimpleOutputElement |
createRoot() |
String |
getLocalName() |
QName |
getName() |
String |
getNameDesc() |
String |
getNamespaceURI() |
SimpleOutputElement |
getParent() |
String |
getPrefix() |
boolean |
isRoot() |
protected SimpleOutputElement |
reuseAsChild(SimpleOutputElement parent,
String localName) |
protected SimpleOutputElement |
reuseAsChild(SimpleOutputElement parent,
String prefix,
String localName,
String uri) |
void |
setDefaultNsUri(String uri) |
void |
setPrefix(String prefix) |
protected void |
setRootNsContext(NamespaceContext ctxt)
Note: this method can and will only be called before outputting
the root element.
|
addPrefix, generateMapping, getDefaultNsUri, getExplicitPrefix, getNamespaceURI, getPrefix, getPrefixes, isPrefixValid, relink, throwOutputError
protected SimpleOutputElement mParent
protected String mPrefix
protected String mLocalName
protected String mURI
mPrefix
maps to.
Non-final only to allow reuse.protected HashSet<com.ctc.wstx.sw.SimpleOutputElement.AttrName> mAttrSet
public static SimpleOutputElement createRoot()
protected SimpleOutputElement createChild(String localName)
protected SimpleOutputElement reuseAsChild(SimpleOutputElement parent, String localName)
protected SimpleOutputElement reuseAsChild(SimpleOutputElement parent, String prefix, String localName, String uri)
protected SimpleOutputElement createChild(String prefix, String localName, String uri)
protected void addToPool(SimpleOutputElement poolHead)
public SimpleOutputElement getParent()
public boolean isRoot()
isRoot
in class OutputElementBase
public String getNameDesc()
getNameDesc
in class OutputElementBase
public String getPrefix()
public String getLocalName()
public String getNamespaceURI()
public QName getName()
public void checkAttrWrite(String nsURI, String localName) throws XMLStreamException
XMLStreamException
public void setPrefix(String prefix)
public void setDefaultNsUri(String uri)
setDefaultNsUri
in class OutputElementBase
protected final void setRootNsContext(NamespaceContext ctxt)
setRootNsContext
in class OutputElementBase
Copyright © 2018 FasterXML. All rights reserved.