Class XMLReaderFactory

  extended by org.xml.sax.helpers.XMLReaderFactory

public final class XMLReaderFactory
extends Object

Factory for creating an XML reader.

This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See for further information.

This class contains static methods for creating an XML reader from an explicit class name, or based on runtime defaults:

 try {
   XMLReader myReader = XMLReaderFactory.createXMLReader();
 } catch (SAXException e) {

Note to Distributions bundled with parsers: You should modify the implementation of the no-arguments createXMLReader to handle cases where the external configuration mechanisms aren't set up. That method should do its best to return a parser when one is in the class path, even when nothing bound its class name to org.xml.sax.driver so those configuration mechanisms would see it.

BlackBerry API 4.3.0, SAX 2.0

Method Summary
static XMLReader createXMLReader()
static XMLReader createXMLReader(String className)
          Attempt to create an XML reader from a class name.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static XMLReader createXMLReader()
                                 throws SAXException
BlackBerry API 4.3.0


public static XMLReader createXMLReader(String className)
                                 throws SAXException
Attempt to create an XML reader from a class name.

Given a class name, this method attempts to load and instantiate the class as an XML reader.

Note that this method will not be usable in environments where the caller (perhaps an applet) is not permitted to load classes dynamically.

A new XML reader.
SAXException - If the class cannot be loaded, instantiated, and cast to XMLReader.
See Also:
BlackBerry API 4.3.0

Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.