JAXPUtils (Apache Ant API)

org.apache.tools.ant.util
Class JAXPUtils


java.lang.Object

  |

  +--org.apache.tools.ant.util.JAXPUtils


public class JAXPUtils
extends java.lang.Object

Collection of helper methods that retrieve a ParserFactory or Parsers and Readers.

This class will create only a single factory instance.

Since:
Ant 1.5
Author:
Stefan Bodewig

Constructor Summary
JAXPUtils()
           
 
Method Summary
static org.xml.sax.Parser getParser()
          Returns a newly created SAX 1 Parser, using the default parser factory.
static javax.xml.parsers.SAXParserFactory getParserFactory()
          Returns the parser factory to use.
static org.xml.sax.XMLReader getXMLReader()
          Returns a newly created SAX 2 XMLReader, using the default parser factory.
static javax.xml.parsers.SAXParserFactory newParserFactory()
          Returns a new parser factory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXPUtils


public JAXPUtils()
Method Detail

getParserFactory


public static javax.xml.parsers.SAXParserFactory getParserFactory()
                                                           throws BuildException
Returns the parser factory to use. Only one parser factory is ever created by this method and is then cached for future use.

Returns:
a SAXParserFactory to use
BuildException
Since:
Ant 1.5

newParserFactory


public static javax.xml.parsers.SAXParserFactory newParserFactory()
                                                           throws BuildException
Returns a new parser factory instance.

BuildException
Since:
Ant 1.5

getParser


public static org.xml.sax.Parser getParser()
                                    throws BuildException
Returns a newly created SAX 1 Parser, using the default parser factory.

Returns:
a SAX 1 Parser.
BuildException
Since:
Ant 1.5
See Also:
getParserFactory()

getXMLReader


public static org.xml.sax.XMLReader getXMLReader()
                                          throws BuildException
Returns a newly created SAX 2 XMLReader, using the default parser factory.

Returns:
a SAX 2 XMLReader.
BuildException
Since:
Ant 1.5
See Also:
getParserFactory()


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.