Apache CXF API

org.apache.cxf.aegis.util.jdom
Class StaxBuilder

java.lang.Object
  extended by org.apache.cxf.aegis.util.jdom.StaxBuilder

public class StaxBuilder
extends Object

Builds a JDOM org.jdom.Document using a XMLStreamReader.

Author:
Tatu Saloranta, Bradley S. Huffman, Benson I. Margulies, mods for CXF to allow reading a portion of a stream.

Field Summary
protected  boolean cfgIgnoreWS
          Whether ignorable white space should be ignored, ie not added in the resulting JDOM tree.
 
Constructor Summary
StaxBuilder()
          Default constructor.
StaxBuilder(Map<String,String> namespaces)
           
 
Method Summary
 Document build(InputStream is)
           
 Document build(Reader reader)
           
 Document build(XMLStreamReader r)
          This will build a JDOM tree given a StAX stream reader.
 Map<String,String> getAdditionalNamespaces()
           
 JDOMFactory getFactory()
          Returns the current org.jdom.JDOMFactory in use, if one has been previously set with setFactory(JDOMFactory), otherwise null.
 void setAdditionalNamespaces(Map<String,String> additionalNamespaces)
           
 void setFactory(JDOMFactory f)
           
 void setIgnoreWhitespace(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cfgIgnoreWS

protected boolean cfgIgnoreWS
Whether ignorable white space should be ignored, ie not added in the resulting JDOM tree. If true, it will be ignored; if false, it will be added in the tree. Default value if false.

Constructor Detail

StaxBuilder

public StaxBuilder()
Default constructor.


StaxBuilder

public StaxBuilder(Map<String,String> namespaces)
Method Detail

getAdditionalNamespaces

public Map<String,String> getAdditionalNamespaces()

setAdditionalNamespaces

public void setAdditionalNamespaces(Map<String,String> additionalNamespaces)

setFactory

public void setFactory(JDOMFactory f)

setIgnoreWhitespace

public void setIgnoreWhitespace(boolean state)

getFactory

public JDOMFactory getFactory()
Returns the current org.jdom.JDOMFactory in use, if one has been previously set with setFactory(JDOMFactory), otherwise null.

Returns:
the factory builder will use

build

public 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 Document build(InputStream is)
               throws XMLStreamException
Throws:
XMLStreamException

build

public Document build(Reader reader)
               throws XMLStreamException
Throws:
XMLStreamException

Apache CXF API

Apache CXF