Joda System API

org.joda.property.xml
Class SAXBuilder

java.lang.Object
  |
  +--org.joda.property.xml.SAXBuilder

public class SAXBuilder
extends java.lang.Object

Build the properties from a SAX XML stream.

Author:
JDOM team, Stephen Colebourne, Andy Lehane

Constructor Summary
SAXBuilder()
          Constructor for XMLOutputter
SAXBuilder(XMLMetaData style)
          Constructor for XMLOutputter taking a XMLMetaData style
 
Method Summary
 Bean build(char[] array)
          Build the model root node from a character array.
 Bean build(java.io.File file)
          Build the model root node from a File.
 Bean build(org.xml.sax.InputSource in)
          Build the model root node from the specified SAX input source.
 Bean build(java.io.InputStream in)
          Build the model root node from an input stream.
 Bean build(java.io.Reader reader)
          Build the model root node from a Reader.
 Bean build(java.lang.String systemId)
          Build the model root node from a string URI.
 Bean build(java.net.URL url)
          Build the model root node from a URL.
protected  void configureContentHandler(SAXHandler handler)
          Configure the SAXHandler
protected  void configureParser(org.xml.sax.XMLReader parser, SAXHandler contentHandler)
          Configure the XMLReader to read the XML input.
protected  SAXHandler createContentHandler()
          Template method to create the content handler to use for parsing
protected  org.xml.sax.XMLReader createParser()
          Creates the XMLReader to be used for reading the XML document.
 java.lang.String getSAXDriverClassName()
          Get the SAX driver classname
 void setSAXDriverClassName(java.lang.String saxDriverClass)
          Set the SAX driver classname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXBuilder

public SAXBuilder()
Constructor for XMLOutputter


SAXBuilder

public SAXBuilder(XMLMetaData style)
Constructor for XMLOutputter taking a XMLMetaData style

Method Detail

build

public Bean build(org.xml.sax.InputSource in)
           throws java.text.ParseException
Build the model root node from the specified SAX input source. The input source can be created from more convenient methods.

Parameters:
in - the input source to read
Returns:
the created model root node
Throws:
java.text.ParseException - if an error occurs

createContentHandler

protected SAXHandler createContentHandler()
                                   throws java.lang.Exception
Template method to create the content handler to use for parsing

Returns:
the SAXHandler to use
java.lang.Exception

configureContentHandler

protected void configureContentHandler(SAXHandler handler)
                                throws java.lang.Exception
Configure the SAXHandler

Parameters:
handler - the handler to configure
java.lang.Exception

createParser

protected org.xml.sax.XMLReader createParser()
                                      throws java.lang.Exception
Creates the XMLReader to be used for reading the XML document.

This uses the specified SAX driver class if available, otherwise it uses JAXP

Returns:
the XMLReader
java.lang.Exception

configureParser

protected void configureParser(org.xml.sax.XMLReader parser,
                               SAXHandler contentHandler)
                        throws java.lang.Exception
Configure the XMLReader to read the XML input.

Parameters:
parser - the parser to configure
contentHandler - the SAX content handler
java.lang.Exception

build

public Bean build(java.io.InputStream in)
           throws java.text.ParseException
Build the model root node from an input stream.

Parameters:
in - the InputStream to read from
Returns:
the parsed model root node
Throws:
java.text.ParseException - when an error occurs

build

public Bean build(java.io.File file)
           throws java.text.ParseException
Build the model root node from a File.

Parameters:
file - the File to read from
Returns:
ModelRootNode - resultant ModelRootNode object.
Throws:
java.text.ParseException - when an error occurs

build

public Bean build(java.net.URL url)
           throws java.text.ParseException
Build the model root node from a URL.

Parameters:
url - the URL to read from
Returns:
the parsed model root node
Throws:
java.text.ParseException - when an error occurs

build

public Bean build(java.io.Reader reader)
           throws java.text.ParseException
Build the model root node from a Reader.

Parameters:
reader - the Reader to read from
Returns:
the parsed model root node
Throws:
java.text.ParseException - when an error occurs

build

public Bean build(java.lang.String systemId)
           throws java.text.ParseException
Build the model root node from a string URI.

Parameters:
systemId - a URI
Returns:
the parsed model root node
Throws:
java.text.ParseException - when an error occurs

build

public Bean build(char[] array)
           throws java.text.ParseException
Build the model root node from a character array.

Parameters:
array - the array to read from
Returns:
the parsed model root node
Throws:
java.text.ParseException - when an error occurs

getSAXDriverClassName

public java.lang.String getSAXDriverClassName()
Get the SAX driver classname

Returns:
the SAX driver classname

setSAXDriverClassName

public void setSAXDriverClassName(java.lang.String saxDriverClass)
Set the SAX driver classname

Parameters:
saxDriverClass - the sax driver classname

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.