JDOM
2.0.5

org.jdom2.input.sax
Class XMLReaderSAX2Factory

java.lang.Object
  extended by org.jdom2.input.sax.XMLReaderSAX2Factory
All Implemented Interfaces:
XMLReaderJDOMFactory

public class XMLReaderSAX2Factory
extends java.lang.Object
implements XMLReaderJDOMFactory

Create XMLReaders directly from the SAX2.0 API using a SAX Driver class name or the default SAX2.0 location process.

Unless you have good reason to use this mechanism you should rather use the JAXP-based processes. Read the package documentation for other alternatives.

Author:
Rolf Lear
See Also:
org.jdom2.input.sax

Constructor Summary
XMLReaderSAX2Factory(boolean validate)
          The required details for SAX2.0-based XMLReader creation.
XMLReaderSAX2Factory(boolean validate, java.lang.String saxdriver)
          The required details for SAX2.0-based XMLReader creation.
 
Method Summary
 org.xml.sax.XMLReader createXMLReader()
          Return a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance.
 java.lang.String getDriverClassName()
          Get the SAX Driver class name used to boostrap XMLReaders.
 boolean isValidating()
          Does an XMLReader from this factory do more than just well-formed checks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLReaderSAX2Factory

public XMLReaderSAX2Factory(boolean validate)
The required details for SAX2.0-based XMLReader creation.

Parameters:
validate - whether to validate against the DocType
See Also:
XMLReaders.NONVALIDATING, XMLReaders.DTDVALIDATING, XMLReaders.XSDVALIDATING

XMLReaderSAX2Factory

public XMLReaderSAX2Factory(boolean validate,
                            java.lang.String saxdriver)
The required details for SAX2.0-based XMLReader creation.

Parameters:
validate - whether to validate against the DocType
saxdriver - The SAX2.0 Driver classname (null to use the SAX2.0 default parser searching algorithm - if you specify null you should probably be using JAXP anyway).
See Also:
XMLReaders.NONVALIDATING, XMLReaders.DTDVALIDATING, XMLReaders.XSDVALIDATING
Method Detail

createXMLReader

public org.xml.sax.XMLReader createXMLReader()
                                      throws JDOMException
Description copied from interface: XMLReaderJDOMFactory
Return a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance. The XMLReader is expected to be a new instance that is unrelated to any other XMLReaders, and can be reused at will by SAXBuilder.

Specified by:
createXMLReader in interface XMLReaderJDOMFactory
Returns:
a new XMLReader
Throws:
JDOMException - if an XMLReader was not available.

getDriverClassName

public java.lang.String getDriverClassName()
Get the SAX Driver class name used to boostrap XMLReaders.

Returns:
The name of the SAX Driver class (null for SAX2 default class).

isValidating

public boolean isValidating()
Description copied from interface: XMLReaderJDOMFactory
Does an XMLReader from this factory do more than just well-formed checks.

Specified by:
isValidating in interface XMLReaderJDOMFactory
Returns:
true if the XMLReader validates

JDOM
2.0.5

Copyright � 2013 Jason Hunter, Brett McLaughlin. All Rights Reserved.