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 XMLStreamReader.

Version:
$Revision: 1198 $, $Date: 2006-02-15 21:21:25 +0100 (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)
           
StaxBuilder(javax.xml.stream.XMLInputFactory xifactory)
           
 
Method Summary
 org.jdom.Document build(java.io.InputStream is)
           
 org.jdom.Document build(java.io.Reader reader)
           
 org.jdom.Document build(javax.xml.stream.XMLStreamReader r)
          This will build a JDOM tree given a StAX stream reader.
 java.util.Map getAdditionalNamespaces()
           
 org.jdom.JDOMFactory getFactory()
          Returns the current JDOMFactory in use, if one has been previously set with setFactory(org.jdom.JDOMFactory), otherwise null.
 void setAdditionalNamespaces(java.util.Map additionalNamespaces)
           
 void setFactory(org.jdom.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)

StaxBuilder

public StaxBuilder(javax.xml.stream.XMLInputFactory xifactory)
Method Detail

getAdditionalNamespaces

public java.util.Map getAdditionalNamespaces()

setAdditionalNamespaces

public void setAdditionalNamespaces(java.util.Map additionalNamespaces)

setFactory

public void setFactory(org.jdom.JDOMFactory f)

setIgnoreWhitespace

public void setIgnoreWhitespace(boolean state)

getFactory

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

Returns:
the factory builder will use

build

public org.jdom.Document build(javax.xml.stream.XMLStreamReader r)
                        throws javax.xml.stream.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:
javax.xml.stream.XMLStreamException - If the reader threw such exception (to indicate a parsing or I/O problem)

build

public org.jdom.Document build(java.io.InputStream is)
                        throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

build

public org.jdom.Document build(java.io.Reader reader)
                        throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2004-2011. All Rights Reserved.