Package com.fasterxml.aalto.dom
Class DOMOutputElement
java.lang.Object
com.fasterxml.aalto.dom.OutputElementBase
com.fasterxml.aalto.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.Fields inherited from class com.fasterxml.aalto.dom.OutputElementBase
_defaultNsURI, _nsMapping, _nsMapShared, _rootNsContext, PREFIX_MISBOUND, PREFIX_OK, PREFIX_UNBOUND
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Constructor for the virtual root elementprivate
DOMOutputElement
(DOMOutputElement parent, Element element, BijectiveNsMap ns) -
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
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.fasterxml.aalto.dom.OutputElementBase
addPrefix, generateMapping, getDefaultNsUri, getExplicitPrefix, getNamespaceURI, getPrefix, getPrefixes, isPrefixValid, relink, throwOutputError
-
Field Details
-
_parent
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). -
_element
Actual DOM element for which this element object acts as a proxy. -
_defaultNsSet
private boolean _defaultNsSet
-
-
Constructor Details
-
DOMOutputElement
private 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. Element is assumed to use the current 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
-