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 booleanprivate ElementActual DOM element for which this element object acts as a proxy.private DOMOutputElementReference to the parent element, element enclosing this element.private final NodeDOM 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
ConstructorsModifierConstructorDescriptionprivateDOMOutputElement(DOMOutputElement parent, Element element, BijectiveNsMap ns) privateDOMOutputElement(Node rootNode) Constructor for the virtual root element -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttribute(String pname, String value) protected voidaddAttribute(String uri, String qname, String value) protected voidaddToPool(DOMOutputElement poolHead) Method called to temporarily link this instance to a pool, to allow reusing of instances with the same reader.voidappendChild(Node n) protected voidappendNode(Node n) protected DOMOutputElementcreateAndAttachChild(Element element) Simplest factory method, which gets called when a 1-argument element output method is called.protected DOMOutputElementcreateChild(Element element) static DOMOutputElementcreateRoot(Node rootNode) booleanisRoot()private voidrelink(DOMOutputElement parent, Element element) Method called to reuse a pooled instance.protected DOMOutputElementreuseAsChild(DOMOutputElement parent, Element element) voidsetDefaultNsUri(String uri) protected voidMethods 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 type,invalid reference
Documentorinvalid reference
DocumentFragmentElement -
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:
isRootin classOutputElementBase
-
getNameDesc
- Specified by:
getNameDescin classOutputElementBase- Returns:
- String presentation of the fully-qualified name, in "prefix:localName" format (no URI). Useful for error and debugging messages.
-
setDefaultNsUri
- Specified by:
setDefaultNsUriin classOutputElementBase
-
setRootNsContext
- Specified by:
setRootNsContextin classOutputElementBase
-
appendNode
-
addAttribute
-
addAttribute
-
appendChild
-