Top Description Fields Constructors Methods
org.jdom2.input.sax

public Class XMLReaderSAX2Factory

extends Object
implements XMLReaderJDOMFactory
Class Inheritance
All Implemented Interfaces
org.jdom2.input.sax.XMLReaderJDOMFactory
Static Imports
org.jdom2.JDOMConstants.*

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

Field Summary

Modifier and TypeField and Description
private final String
private final boolean

Constructor Summary

AccessConstructor and Description
public
XMLReaderSAX2Factory(boolean
whether to validate against the DocType
validate
)

The required details for SAX2.0-based XMLReader creation.

public
XMLReaderSAX2Factory(final boolean
whether to validate against the DocType
validate
,
final String
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).
saxdriver
)

The required details for SAX2.0-based XMLReader creation.

Method Summary

Modifier and TypeMethod and Description
public XMLReader
createXMLReader()

Implements org.jdom2.input.sax.XMLReaderJDOMFactory.createXMLReader.

Return a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance.
public String

Returns:

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

Get the SAX Driver class name used to bootstrap XMLReaders.

public boolean
isValidating()

Implements org.jdom2.input.sax.XMLReaderJDOMFactory.isValidating.

Does an XMLReader from this factory do more than just well-formed checks.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

saxdriverback to summary
private final String saxdriver
validateback to summary
private final boolean validate

Constructor Detail

XMLReaderSAX2Factoryback to summary
public XMLReaderSAX2Factory(boolean validate)

The required details for SAX2.0-based XMLReader creation.

Parameters
validate:boolean

whether to validate against the DocType

See Also
XMLReaders#NONVALIDATING, XMLReaders#DTDVALIDATING, XMLReaders#XSDVALIDATING
XMLReaderSAX2Factoryback to summary
public XMLReaderSAX2Factory(final boolean validate, final String saxdriver)

The required details for SAX2.0-based XMLReader creation.

Parameters
validate:boolean

whether to validate against the DocType

saxdriver:String

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

createXMLReaderback to summary
public XMLReader createXMLReader() throws JDOMException

Implements org.jdom2.input.sax.XMLReaderJDOMFactory.createXMLReader.

Doc from org.jdom2.input.sax.XMLReaderJDOMFactory.createXMLReader.

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.

Returns:XMLReader

a new XMLReader

Annotations
@Override
Exceptions
JDOMException:
if an XMLReader was not available.
getDriverClassNameback to summary
public String getDriverClassName()

Get the SAX Driver class name used to bootstrap XMLReaders.

Returns:String

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

isValidatingback to summary
public boolean isValidating()

Implements org.jdom2.input.sax.XMLReaderJDOMFactory.isValidating.

Doc from org.jdom2.input.sax.XMLReaderJDOMFactory.isValidating.

Does an XMLReader from this factory do more than just well-formed checks.

Returns:boolean

true if the XMLReader validates

Annotations
@Override