Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#inhmethods)

# ParserFactory


`
public


class
ParserFactory
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | org.xml.sax.helpers.ParserFactory |

<br />

*** ** * ** ***


**This class was deprecated
in API level 9.**   

This class works with the deprecated
`https://developer.android.com/reference/org/xml/sax/Parser`
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://developer.android.com/reference/org/xml/sax/Parser` class. SAX2 applications should use
`https://developer.android.com/reference/org/xml/sax/helpers/XMLReaderFactory` 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 />

## Summary

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/org/xml/sax/Parser` | ` https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#makeParser()() ` Create a new SAX parser using the \`org.xml.sax.parser' system property. |
| ` static https://developer.android.com/reference/org/xml/sax/Parser` | ` https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#makeParser(java.lang.String)(https://developer.android.com/reference/java/lang/String className) ` Create a new SAX parser object using the class name provided. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public methods

### makeParser

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Parser makeParser ()
```

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

The named class must exist and must implement the
`https://developer.android.com/reference/org/xml/sax/Parser` interface.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/org/xml/sax/Parser` | the newly created parser. <br /> |

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

**See also:**

- `https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#makeParser(java.lang.String)`
- `https://developer.android.com/reference/org/xml/sax/Parser`

### makeParser

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static Parser makeParser (String className)
```

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

The named class must exist and must implement the
`https://developer.android.com/reference/org/xml/sax/Parser` interface.

<br />

<br />

| Parameters ||
|---|---|
| `className` | `String`: A string containing the name of the SAX parser class. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/org/xml/sax/Parser` | the newly created parser. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ClassCastException` | The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |
| `https://developer.android.com/reference/java/lang/ClassNotFoundException` | The SAX parser class was not found (check your CLASSPATH). |
| `https://developer.android.com/reference/java/lang/IllegalAccessException` | The SAX parser class was found, but you do not have permission to load it. |
| `https://developer.android.com/reference/java/lang/InstantiationException` | The SAX parser class was found but could not be instantiated. |

**See also:**

- `https://developer.android.com/reference/org/xml/sax/helpers/ParserFactory#makeParser()`
- `https://developer.android.com/reference/org/xml/sax/Parser`