|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.io.utils.Stax2DomBuilder
public class Stax2DomBuilder
Builds a DOM Document
using a
XMLStreamReader
.
Field Summary | |
---|---|
protected boolean |
mCfgIgnoreWs
Whether ignorable white space should be ignored, ie not added in the resulting JDOM tree. |
protected String |
mLastLocalName
|
protected String |
mLastPrefix
|
protected String |
mLastQName
|
protected boolean |
mNsAware
|
Constructor Summary | |
---|---|
Stax2DomBuilder()
Default constructor. |
Method Summary | |
---|---|
Document |
build(XMLStreamReader r)
This method will create a Document instance using the
default JAXP mechanism and populate using the given StAX stream reader. |
void |
build(XMLStreamReader r,
Document doc)
This method will populate given Document using the
given StAX stream reader instance. |
Document |
build(XMLStreamReader r,
DocumentBuilder docbuilder)
|
protected void |
buildTree(XMLStreamReader r,
Document doc)
This method takes a XMLStreamReader and builds up a JDOM
tree. |
protected void |
checkReaderSettings(XMLStreamReader r)
|
protected String |
getQualified(String prefix,
String localName)
|
void |
setIgnoreWhitespace(boolean ignoreWS)
Method used to change whether the build methods will add ignorable (element) white space in the DOM tree or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean mCfgIgnoreWs
protected boolean mNsAware
protected String mLastPrefix
protected String mLastLocalName
protected String mLastQName
Constructor Detail |
---|
public Stax2DomBuilder()
Method Detail |
---|
public void setIgnoreWhitespace(boolean ignoreWS)
Whether all-whitespace text segment is ignorable white space or not is based on DTD read in, as per XML specifications (white space is only significant in mixed content or pure text elements).
ignoreWS
- true to ignore whitespace; false otherwise.public Document build(XMLStreamReader r) throws ParserConfigurationException, XMLStreamException
Document
instance using the
default JAXP mechanism and populate using the given StAX stream reader.
r
- Stream reader from which input is read.
Document
- DOM document object.
ParserConfigurationException
- if parse is not configured
XMLStreamException
- If the reader threw such exception (to indicate a parsing or
I/O problem)public Document build(XMLStreamReader r, DocumentBuilder docbuilder) throws XMLStreamException
XMLStreamException
public void build(XMLStreamReader r, Document doc) throws XMLStreamException
Document
using the
given StAX stream reader instance.
r
- Stream reader from which input is read.doc
- Document
- DOM document object.
XMLStreamException
- If the reader threw such exception (to indicate a parsing or
I/O problem)protected void buildTree(XMLStreamReader r, Document doc) throws XMLStreamException
XMLStreamReader
and builds up a JDOM
tree. Recursion has been eliminated by using nodes' parent/child
relationship; this improves performance somewhat (classic
recursion-by-iteration-and-explicit stack transformation)
r
- Stream reader to use for reading the document from which to
build the treedoc
- JDOM Document
being built.
XMLStreamException
- for funprotected String getQualified(String prefix, String localName)
protected void checkReaderSettings(XMLStreamReader r) throws XMLStreamException
XMLStreamException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |