public final class SMBufferedElement extends SMOutputElement implements SMBufferable
SMOutputElement
; starts its life buffered,
so that it, its attributes and content are not automatically written to the
underlying stream, but only when buffered instance is released.
Since the base class properly already implements most of functionality, there is not much extra to do in this class.
Modifier and Type | Field and Description |
---|---|
protected boolean |
_isBuffered
All instances are initially buffered; state will be changed when
instance is released.
|
_localName, _namespace, _outputState, _parentDefaultNs, _parentNsCount, OUTPUT_ATTRS, OUTPUT_CHILDREN, OUTPUT_CLOSED, OUTPUT_NONE
_context, _firstChild, _lastChild, _parent
_next
Modifier | Constructor and Description |
---|---|
protected |
SMBufferedElement(SMOutputContext ctxt,
String localName,
SMNamespace ns)
Note: although signature indicates we could throw an exception,
this sub-class never does.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
_output(SMOutputContext ctxt,
boolean canClose)
Method called to request that the entity output itself; either
as much as it can without closing, or as much as it can if it is to
get closed.
|
protected void |
_throwBuffered() |
boolean |
isBuffered() |
void |
release()
Method called to signal that the node need not be buffered any more
(if not required to do so by parent/children restrictions)
|
_canOutputNewChild, _childReleased, _forceOutput, _throwClosedForAttrs, _throwClosedForNsDecls, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, addAttribute, doWriteEndElement, doWriteStartElement, getLocalName, getNamespace, getPath, linkParent, predeclareNamespace
_closeAllButLastChild, _closeAndOutputChildren, _forceChildOutput, _linkNewChild, _throwClosed, _throwRelinking, _verifyNamespaceArg, addAndReleaseBuffered, addBuffered, addCData, addCData, addCharacters, addCharacters, addComment, addElement, addElement, addElementWithCharacters, addEntityRef, addProcessingInstruction, addValue, addValue, addValue, addValue, addValue, addValue, createBufferedElement, createBufferedFragment, getContext, getNamespace, getNamespace, getParent, getPath, setIndentation
_linkNext, getNext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
linkParent
protected boolean _isBuffered
protected SMBufferedElement(SMOutputContext ctxt, String localName, SMNamespace ns)
Note: although signature indicates we could throw an exception, this sub-class never does. But since super-class in itself could, we have to declare it as potentially being thrown.
public boolean isBuffered()
isBuffered
in interface SMBufferable
public void release() throws XMLStreamException
SMBufferable
release
in interface SMBufferable
XMLStreamException
protected boolean _output(SMOutputContext ctxt, boolean canClose) throws XMLStreamException
SMOutputtable
_output
in class SMOutputElement
ctxt
- Output context to use for outputting this node (and
its contents)canClose
- If true, indicates that the node can (and should)
be fully closed if possible. This (passing true) is usually done
when a new sibling
is added after a node (element/fragment); if so, current one
should be recursively closed. If false, should only try to output
as much as can be done without forcing closures.XMLStreamException
protected void _throwBuffered()
Copyright © 2013 FasterXML. All Rights Reserved.