- Javax.xml.bind classes
- Home
- Binder
- DatatypeConverter
- JAXB
- JAXBContext
- JAXBElement
- JAXBElement.GlobalScope
- JAXBIntrospector
- Marshaller.Listener
- SchemaOutputResolver
- Unmarshaller.Listener
- Javax.xml.bind.util classes
- JAXBResult
- JAXBSource
- ValidationEventCollector
- Javax.xml.parsers classes
- DocumentBuilder
- DocumentBuilderFactory
- SAXParser
- SAXParserFactory
- Javax.xml.soap classes
- AttachmentPart
- MessageFactory
- MimeHeader
- MimeHeaders
- SAAJMetaFactory
- SOAPConnection
- SOAPConnectionFactory
- SOAPFactory
- SOAPMessage
- SOAPPart
- Javax.xml.validation classes
- Schema
- SchemaFactory
- TypeInfoProvider
- Validator
- ValidatorHandler
- Javax.xml.xpath classes
- XPathConstants
- XPathFactory
- Java Useful Resources
- Java - Quick Guide
- Java - Useful Resources
Javax.xml.parsers.SAXParser.getParser() Method
Description
The Javax.xml.parsers.SAXParser.getParser() method returns the SAX parser that is encapsultated by the implementation of this class.
Declaration
Following is the declaration for Javax.xml.parsers.SAXParser.getParser() method
public abstract Parser getParser()
Parameters
NA
Return Value
NA
Exception
NA
Example
The following example shows the usage of Javax.xml.parsers.SAXParser.getParser() method.
package com.tutorialspoint; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; public class SaxParserDemo { public static void main(String[] args) { // create a new SAXParserFactory SAXParserFactory factory = SAXParserFactory.newInstance(); try { // get a new SAXParser SAXParser parser = factory.newSAXParser(); // get the current parser System.out.println("" + parser.getParser()); } catch (Exception ex) { ex.printStackTrace(); } } }
If we compile the code and execute it, this will produce the following result −
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@2d3bad12
javax_xml_parsers_saxparser.htm
Advertisements
To Continue Learning Please Login
Login with Google