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

public abstract Class AbstractReaderSchemaFactory

extends Object
implements XMLReaderJDOMFactory
Class Inheritance
All Implemented Interfaces
org.jdom2.input.sax.XMLReaderJDOMFactory
Known Direct Subclasses
org.jdom2.input.sax.AbstractReaderXSDFactory, org.jdom2.input.sax.XMLReaderSchemaFactory
Imports
javax.xml.parsers.ParserConfigurationException, .SAXParserFactory, javax.xml.validation.Schema, org.xml.sax.SAXException, .XMLReader, org.jdom2.JDOMException

This AbstractReaderSchemaFactory class returns XMLReaders configured to validate against the supplied Schema instance. The Schema could be an XSD schema or some other schema supported by SAX (e.g. RelaxNG). It takes a pre-declared

If you want to validate an XML document against the XSD references embedded in the XML itself (xsdSchemaLocation) then you do not want to use this class but rather use an alternate means like XMLReaders#XSDVALIDATING.

See the package documentation for the best alternatives.

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

Field Summary

Modifier and TypeField and Description
private final SAXParserFactory

Constructor Summary

AccessConstructor and Description
public
AbstractReaderSchemaFactory(final SAXParserFactory
The SAXParserFactory to use for creating XMLReader instances.
fac
,
final Schema
The Schema to use for validation.
schema
)

XMLReader instances from this class will be configured to validate using the supplied Schema instance.

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

saxfacback to summary
private final SAXParserFactory saxfac

Constructor Detail

AbstractReaderSchemaFactoryback to summary
public AbstractReaderSchemaFactory(final SAXParserFactory fac, final Schema schema)

XMLReader instances from this class will be configured to validate using the supplied Schema instance.

Parameters
fac:SAXParserFactory

The SAXParserFactory to use for creating XMLReader instances.

schema:Schema

The Schema to use for validation.

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