org.codehaus.xfire.util.jdom
Class StaxBuilder

java.lang.Object
  extended by org.codehaus.xfire.util.jdom.StaxBuilder

public class StaxBuilder
extends java.lang.Object

Builds a JDOM org.jdom.Document using a javax.xml.stream.XMLStreamReader.

Version:
$Revision: 1198 $, $Date: 2006-02-15 15:21:25 -0500 (Wed, 15 Feb 2006) $
Author:
Tatu Saloranta, Bradley S. Huffman

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(java.util.Map namespaces)
           
 
Method Summary
 Document build(XMLStreamReader r)
          This will build a JDOM tree given a StAX stream reader.
 java.util.Map getAdditionalNamespaces()
           
 JDOMFactory getFactory()
          Returns the current org.jdom.JDOMFactory in use, if one has been previously set with setFactory(JDOMFactory), otherwise null.
 void setAdditionalNamespaces(java.util.Map 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(java.util.Map namespaces)
Method Detail

getAdditionalNamespaces

public java.util.Map getAdditionalNamespaces()

setAdditionalNamespaces

public void setAdditionalNamespaces(java.util.Map 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.

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)


Copyright © 2004-2006 Envoi Solutions LLC. All Rights Reserved.