Stay organized with collections
Save and categorize content based on your preferences.
ParserFactory
open class ParserFactory
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 Parser
class. SAX2 applications should use 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.
Summary
Public methods |
open static Parser! |
Create a new SAX parser using the `org.
|
open static Parser! |
Create a new SAX parser object using the class name provided.
|
Public methods
makeParser
open static fun makeParser(): Parser!
Deprecated: Deprecated in Java.
Create a new SAX parser using the `org.xml.sax.parser' system property.
The named class must exist and must implement the Parser
interface.
Return |
Parser! |
the newly created parser. |
Exceptions |
java.lang.NullPointerException |
There is no value for the `org.xml.sax.parser' system property. |
java.lang.ClassNotFoundException |
The SAX parser class was not found (check your CLASSPATH). |
java.lang.IllegalAccessException |
The SAX parser class was found, but you do not have permission to load it. |
java.lang.InstantiationException |
The SAX parser class was found but could not be instantiated. |
java.lang.ClassCastException |
The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |
makeParser
open static fun makeParser(className: String!): Parser!
Deprecated: Deprecated in Java.
Create a new SAX parser object using the class name provided.
The named class must exist and must implement the Parser
interface.
Parameters |
className |
String!: A string containing the name of the SAX parser class. |
Return |
Parser! |
the newly created parser. |
Exceptions |
java.lang.ClassNotFoundException |
The SAX parser class was not found (check your CLASSPATH). |
java.lang.IllegalAccessException |
The SAX parser class was found, but you do not have permission to load it. |
java.lang.InstantiationException |
The SAX parser class was found but could not be instantiated. |
java.lang.ClassCastException |
The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ParserFactory\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nParserFactory\n=============\n\n```\nopen class ParserFactory\n```\n\n|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [org.xml.sax.helpers.ParserFactory](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 9.**\n|\n| This class works with the deprecated [Parser](../Parser.html#) interface.\n\nJava-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 \u003chttp://www.saxproject.org\u003e for further information.\n\n**Note:** This class is designed to work with the now-deprecated SAX1 [Parser](../Parser.html#) class. SAX2 applications should use [XMLReaderFactory](/reference/kotlin/org/xml/sax/helpers/XMLReaderFactory) instead.\n\nParserFactory 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.\n\nNote that the application still requires an XML parser that implements SAX1.\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open static [Parser](../Parser.html#)! | [makeParser](#makeParser())`()` Create a new SAX parser using the \\`org. |\n| open static [Parser](../Parser.html#)! | [makeParser](#makeParser(kotlin.String))`(`className:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Create a new SAX parser object using the class name provided. |\n\nPublic methods\n--------------\n\n### makeParser\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun makeParser(): Parser!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCreate a new SAX parser using the \\`org.xml.sax.parser' system property.\n\nThe named class must exist and must implement the [Parser](../Parser.html#) interface.\n\n| Return ||\n|----------------------------|---------------------------|\n| [Parser](../Parser.html#)! | the newly created parser. |\n\n| Exceptions ||\n|------------------------------------|---------------------------------------------------------------------------------------------|\n| `java.lang.NullPointerException` | There is no value for the \\`org.xml.sax.parser' system property. |\n| `java.lang.ClassNotFoundException` | The SAX parser class was not found (check your CLASSPATH). |\n| `java.lang.IllegalAccessException` | The SAX parser class was found, but you do not have permission to load it. |\n| `java.lang.InstantiationException` | The SAX parser class was found but could not be instantiated. |\n| `java.lang.ClassCastException` | The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |\n\n**See Also**\n\n- [#makeParser(java.lang.String)](#makeParser(kotlin.String))\n- [org.xml.sax.Parser](../Parser.html#) \n\n### makeParser\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun makeParser(className: String!): Parser!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCreate a new SAX parser object using the class name provided.\n\nThe named class must exist and must implement the [Parser](../Parser.html#) interface.\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `className` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: A string containing the name of the SAX parser class. |\n\n| Return ||\n|----------------------------|---------------------------|\n| [Parser](../Parser.html#)! | the newly created parser. |\n\n| Exceptions ||\n|------------------------------------|---------------------------------------------------------------------------------------------|\n| `java.lang.ClassNotFoundException` | The SAX parser class was not found (check your CLASSPATH). |\n| `java.lang.IllegalAccessException` | The SAX parser class was found, but you do not have permission to load it. |\n| `java.lang.InstantiationException` | The SAX parser class was found but could not be instantiated. |\n| `java.lang.ClassCastException` | The SAX parser class was found and instantiated, but does not implement org.xml.sax.Parser. |\n\n**See Also**\n\n- \u003c#makeParser()\u003e\n- [org.xml.sax.Parser](../Parser.html#)"]]