# ParserFactory

public class **ParserFactory** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  


**This class is deprecated.**   
This class works with the deprecated
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html`
interface.

Java-specific class for dynamically loading SAX parsers.

> *This module, both source code and documentation, is in the
> Public Domain, and comes with **NO WARRANTY**.* See <http://www.saxproject.org> for further information.

**Note:** This class is designed to work with the now-deprecated
SAX1 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html` class. SAX2 applications should use
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderFactory.html` instead.

ParserFactory is not part of the platform-independent definition
of SAX; it is an additional convenience class designed
specifically for Java XML application writers. SAX applications
can use the static methods in this class to allocate a SAX parser
dynamically at run-time based either on the value of the
\`org.xml.sax.parser' system property or on a string containing the class
name.

Note that the application still requires an XML parser that
implements SAX1.

<br />

### Public Method Summary

|---|---|
| static [Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html) | [makeParser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/ParserFactory.html#makeParser())() Create a new SAX parser using the \`org.xml.sax.parser' system property. |
| static [Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html) | [makeParser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/ParserFactory.html#makeParser(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) className) Create a new SAX parser object using the class name provided. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Methods

#### public static [Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html)
**makeParser**
()

Create a new SAX parser using the \`org.xml.sax.parser' system property.

The named class must exist and must implement the
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html` interface.

<br />

##### Returns

- the newly created parser.

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | There is no value for the \`org.xml.sax.parser' system property. |
| [ClassNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassNotFoundException.html) | The SAX parser class was not found (check your CLASSPATH). |
| [IllegalAccessException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalAccessException.html) | The SAX parser class was found, but you do not have permission to load it. |
| [InstantiationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InstantiationException.html) | The SAX parser class was found but could not be instantiated. |
| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) | The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/ParserFactory.html#makeParser(java.lang.String)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html`

#### public static [Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html)
**makeParser**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) className)

Create a new SAX parser object using the class name provided.

The named class must exist and must implement the
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html` interface.

<br />

##### Parameters

| className | A string containing the name of the SAX parser class. |
|---|---|

##### Returns

- the newly created parser.

##### Throws

| [ClassNotFoundException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassNotFoundException.html) | The SAX parser class was not found (check your CLASSPATH). |
| [IllegalAccessException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/IllegalAccessException.html) | The SAX parser class was found, but you do not have permission to load it. |
| [InstantiationException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/InstantiationException.html) | The SAX parser class was found but could not be instantiated. |
| [ClassCastException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/ClassCastException.html) | The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/ParserFactory.html#makeParser()`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html`