|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.xml.javax.converter.support.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(javax.xml.stream.XMLStreamReader r)
This method will create a Document instance using
the default JAXP mechanism and
populate using the given StAX stream reader. |
void |
build(javax.xml.stream.XMLStreamReader r,
Document doc)
This method will populate given Document using
the given StAX stream reader instance. |
Document |
build(javax.xml.stream.XMLStreamReader r,
DocumentBuilder docbuilder)
|
protected void |
buildTree(javax.xml.stream.XMLStreamReader r,
Document doc)
This method takes a XMLStreamReader and builds up
a JDOM tree. |
protected void |
checkReaderSettings(javax.xml.stream.XMLStreamReader r)
|
protected String |
getQualified(String prefix,
String localName)
|
static void |
main(String[] args)
Trivial test driver for testing functionality. |
void |
setIgnoreWhitespace(boolean state)
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 state)
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).
public Document build(javax.xml.stream.XMLStreamReader r)
throws ParserConfigurationException,
javax.xml.stream.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.
javax.xml.stream.XMLStreamException - If the reader threw such exception (to
indicate a parsing or I/O problem)
ParserConfigurationException
public Document build(javax.xml.stream.XMLStreamReader r,
DocumentBuilder docbuilder)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void build(javax.xml.stream.XMLStreamReader r,
Document doc)
throws javax.xml.stream.XMLStreamException
Document using
the given StAX stream reader instance.
r - Stream reader from which input is read.
javax.xml.stream.XMLStreamException - If the reader threw such exception (to
indicate a parsing or I/O problem)
protected void buildTree(javax.xml.stream.XMLStreamReader r,
Document doc)
throws javax.xml.stream.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)
javax.xml.stream.XMLStreamException
protected String getQualified(String prefix,
String localName)
protected void checkReaderSettings(javax.xml.stream.XMLStreamReader r)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||