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) {
System.err.println(e.getMessage());
}
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.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static XMLReader | |
| public static XMLReader | Returns: A new XML reader.a class name className)Attempt to create an XML reader from a class name. |
| private static <T> T | |
| private static String | Returns: the name of the provider, or null if nothing is foundthe ClassLoader to be used to read the service file loader)Locates a provider by directly reading the jar service file. |
| private static XMLReader |
| property | back to summary |
|---|---|
| private static final String property | |
| XMLReaderFactory | back to summary |
|---|---|
| private XMLReaderFactory() Private constructor. This constructor prevents the class from being instantiated. | |
| createXMLReader | back to summary |
|---|---|
| public static XMLReader createXMLReader() throws SAXException Obtains a new instance of a
API Note The process that looks for a class name in the
| |
| createXMLReader | back to summary |
|---|---|
| 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.
| |
| findServiceProvider | back to summary |
|---|---|
| private static <T> T findServiceProvider(final Class<T> type, final ClassLoader loader) throws SAXException | |
| jarLookup | back to summary |
|---|---|
| private static String jarLookup(final ClassLoader loader) Locates a provider by directly reading the jar service file.
| |
| loadClass | back to summary |
|---|---|
| private static XMLReader loadClass(ClassLoader loader, String className) throws SAXException | |