Package org.apache.cxf.aegis.util.jdom
Class StaxBuilder
- java.lang.Object
-
- org.apache.cxf.aegis.util.jdom.StaxBuilder
-
public class StaxBuilder extends Object
Builds a JDOMorg.jdom.Documentusing aXMLStreamReader.- Author:
- Tatu Saloranta, Bradley S. Huffman, Benson I. Margulies, mods for CXF to allow reading a portion of a stream.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancfgIgnoreWSWhether ignorable white space should be ignored, ie not added in the resulting JDOM tree.
-
Constructor Summary
Constructors Constructor Description StaxBuilder()Default constructor.StaxBuilder(Map<String,String> namespaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jdom.Documentbuild(InputStream is)org.jdom.Documentbuild(Reader reader)org.jdom.Documentbuild(XMLStreamReader r)This will build a JDOM tree given a StAX stream reader.Map<String,String>getAdditionalNamespaces()org.jdom.JDOMFactorygetFactory()Returns the currentJDOMFactoryin use, if one has been previously set withsetFactory(org.jdom.JDOMFactory), otherwise null.voidsetAdditionalNamespaces(Map<String,String> additionalNamespaces)voidsetFactory(org.jdom.JDOMFactory f)voidsetIgnoreWhitespace(boolean state)
-
-
-
Method Detail
-
setAdditionalNamespaces
public void setAdditionalNamespaces(Map<String,String> additionalNamespaces)
-
setFactory
public void setFactory(org.jdom.JDOMFactory f)
-
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean state)
-
getFactory
public org.jdom.JDOMFactory getFactory()
Returns the currentJDOMFactoryin use, if one has been previously set withsetFactory(org.jdom.JDOMFactory), otherwise null.- Returns:
- the factory builder will use
-
build
public org.jdom.Document build(XMLStreamReader r) throws XMLStreamException
This will build a JDOM tree given a StAX stream reader. This API explicitly supports building mid-stream.- Parameters:
r- Stream reader from which input is read.- Returns:
Document- JDOM document object.- Throws:
XMLStreamException- If the reader threw such exception (to indicate a parsing or I/O problem)
-
build
public org.jdom.Document build(InputStream is) throws XMLStreamException
- Throws:
XMLStreamException
-
build
public org.jdom.Document build(Reader reader) throws XMLStreamException
- Throws:
XMLStreamException
-
-