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

public Class XMLReaderJAXPFactory

extends Object
implements XMLReaderJDOMFactory
Class Inheritance
All Implemented Interfaces
org.jdom2.input.sax.XMLReaderJDOMFactory
Imports
javax.xml.parsers.ParserConfigurationException, .SAXParserFactory, org.xml.sax.SAXException, .XMLReader, org.jdom2.JDOMException

Create XMLReaders directly from the javax.xml.parsers.SAXParserFactory API using an explicit implementation of the parser instead of relying on the default JAXP search path.

If you want to rely on the default JAXP search mechanism you should instead use one of the simple members of the XMLReaders enumeration, or use one of the simple constructors on XMLReaderXSDFactory or XMLReaderSchemaFactory.

See the documentation for SAXParserFactory for the details on what the factoryClassName and classLoader should be.

Author
Rolf Lear
Since
2.0.3
See Also
org.jdom2.input.sax

Field Summary

Modifier and TypeField and Description
private final SAXParserFactory
private final boolean

Constructor Summary

AccessConstructor and Description
public
XMLReaderJAXPFactory(final String
The name of the implementation to use for the SAXParserFactory.
factoryClassName
,
final ClassLoader
The classloader to use for locating the SAXParserFactory (may be null).
classLoader
,
boolean
Whether this should create DTD Validating XMLReaders.
dtdvalidate
)

Create an XMLReaderJAXPFactory using the specified factory name, classloader, and dtdvalidating flag.

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 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

instanceback to summary
private final SAXParserFactory instance
validatingback to summary
private final boolean validating

Constructor Detail

XMLReaderJAXPFactoryback to summary
public XMLReaderJAXPFactory(final String factoryClassName, final ClassLoader classLoader, boolean dtdvalidate)

Create an XMLReaderJAXPFactory using the specified factory name, classloader, and dtdvalidating flag.

Parameters
factoryClassName:String

The name of the implementation to use for the SAXParserFactory.

classLoader:ClassLoader

The classloader to use for locating the SAXParserFactory (may be null).

dtdvalidate:boolean

Whether this should create DTD Validating XMLReaders.

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.
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