Package com.ctc.wstx.dom
Class DOMOutputElement
java.lang.Object
com.ctc.wstx.sw.OutputElementBase
com.ctc.wstx.dom.DOMOutputElement
- All Implemented Interfaces:
NamespaceContext
Context object that holds information about an open element
(one for which START_ELEMENT has been sent, but no END_ELEMENT)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private Element
Actual DOM element for which this element object acts as a proxy.private DOMOutputElement
Reference to the parent element, element enclosing this element.private final Node
DOM node that is the root under which content is written, in case where there is no parent (mParent == null).Fields inherited from class com.ctc.wstx.sw.OutputElementBase
DEFAULT_XML_BINDINGS, mDefaultNsURI, mNsMapping, mNsMapShared, mRootNsContext, PREFIX_MISBOUND, PREFIX_OK, PREFIX_UNBOUND, sXmlNsPrefix, sXmlNsURI
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DOMOutputElement
(DOMOutputElement parent, Element element, BijectiveNsMap ns) private
DOMOutputElement
(Node rootNode) Constructor for the virtual root element -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttribute
(String pname, String value) protected void
addAttribute
(String uri, String qname, String value) protected void
addToPool
(DOMOutputElement poolHead) Method called to temporarily link this instance to a pool, to allow reusing of instances with the same reader.void
appendChild
(Node n) protected void
appendNode
(Node n) protected DOMOutputElement
createAndAttachChild
(Element element) Simplest factory method, which gets called when a 1-argument element output method is called.protected DOMOutputElement
createChild
(Element element) static DOMOutputElement
createRoot
(Node rootNode) boolean
isRoot()
private void
relink
(DOMOutputElement parent, Element element) Method called to reuse a pooled instance.protected DOMOutputElement
reuseAsChild
(DOMOutputElement parent, Element element) void
setDefaultNsUri
(String uri) protected void
Methods inherited from class com.ctc.wstx.sw.OutputElementBase
addPrefix, generateMapping, getDefaultNsUri, getExplicitPrefix, getNamespaceURI, getPrefix, getPrefixes, isPrefixValid, relink, throwOutputError
-
Field Details
-
mParent
Reference to the parent element, element enclosing this element. Null for root element. Non-final to allow temporary pooling (on per-writer basis, to keep these short-lived). -
mRootNode
DOM node that is the root under which content is written, in case where there is no parent (mParent == null). If mParent is not null, this will be null. Value is of typeinvalid reference
Document
invalid reference
DocumentFragment
Element
-
mElement
Actual DOM element for which this element object acts as a proxy. -
mDefaultNsSet
private boolean mDefaultNsSet
-
-
Constructor Details
-
DOMOutputElement
Constructor for the virtual root element -
DOMOutputElement
-
-
Method Details
-
relink
Method called to reuse a pooled instance. -
createRoot
-
createAndAttachChild
Simplest factory method, which gets called when a 1-argument element output method is called. It is, then, assumed to use the default namespace. Will both create the child element and attach it to parent element, or lacking own owner document. -
createChild
-
reuseAsChild
- Returns:
- New head of the recycle pool
-
addToPool
Method called to temporarily link this instance to a pool, to allow reusing of instances with the same reader. -
getParent
-
isRoot
public boolean isRoot()- Specified by:
isRoot
in classOutputElementBase
-
getNameDesc
- Specified by:
getNameDesc
in classOutputElementBase
- Returns:
- String presentation of the fully-qualified name, in "prefix:localName" format (no URI). Useful for error and debugging messages.
-
setDefaultNsUri
- Specified by:
setDefaultNsUri
in classOutputElementBase
-
setRootNsContext
- Specified by:
setRootNsContext
in classOutputElementBase
-
appendNode
-
addAttribute
-
addAttribute
-
appendChild
-