|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdom2.input.StAXEventBuilder
public class StAXEventBuilder
Builds a JDOM Document from a StAX-based XMLEventReader.
XMLEventReaders are pre-configured and as a result JDOM is not able to alter whether the input is validated, or whether the Events have escaped entities or not. These (and other) characteristics are configurable by setting the correct features and properties on the XMLInputFactory when it is used to create the XMLStreamReader.
Useful configuration to set, or know about is:
http://java.sun.com/xml/stream/properties/report-cdata-event
for the default Java StAX implementation, or the equivalent property for your
StAX engine.
From a JDOM perspective XMLStreamReaders are more efficient than XMLEventReaders. Where possible use an XMLStreamReader.
If you happen to be looking at the source code, pay careful attention to the imports so you know what type of instance is being processed, whether it is a StAX class, or a JDOM class, because there are name conflicts.
Constructor Summary | |
---|---|
StAXEventBuilder()
|
Method Summary | |
---|---|
Document |
build(javax.xml.stream.XMLEventReader events)
This builds a document from the supplied XMLEventReader. |
JDOMFactory |
getFactory()
Returns the current JDOMFactory in use. |
void |
setFactory(JDOMFactory factory)
This sets a custom JDOMFactory for the builder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StAXEventBuilder()
Method Detail |
---|
public JDOMFactory getFactory()
JDOMFactory
in use.
public void setFactory(JDOMFactory factory)
factory
- JDOMFactory
to usepublic Document build(javax.xml.stream.XMLEventReader events) throws JDOMException
The JDOMContent will be built by the current JDOMFactory.
events
- XMLEventReader
to read from
Document
resultant Document object
JDOMException
- when errors occur in parsing
|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |