|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.sw.OutputElementBase
com.ctc.wstx.sw.SimpleOutputElement
public final class SimpleOutputElement
Class that encapsulates information about a specific element in virtual output stack for namespace-aware writers. It provides support for URI-to-prefix mappings as well as namespace mapping generation.
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).
Field Summary | |
---|---|
protected HashSet |
mAttrSet
Map used to check for duplicate attribute declarations, if feature is enabled. |
Fields inherited from class com.ctc.wstx.sw.OutputElementBase |
---|
mDefaultNsURI, mNsMapping, mNsMapShared, mRootNsContext, PREFIX_MISBOUND, PREFIX_OK, PREFIX_UNBOUND |
Method Summary | |
---|---|
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. |
Methods inherited from class com.ctc.wstx.sw.OutputElementBase |
---|
addPrefix, generateMapping, getDefaultNsUri, getExplicitPrefix, getNamespaceURI, getPrefix, getPrefixes, isPrefixValid, relink, throwOutputError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashSet mAttrSet
Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |