Package org.jdom2.input.sax
Class AbstractReaderSchemaFactory
java.lang.Object
org.jdom2.input.sax.AbstractReaderSchemaFactory
- All Implemented Interfaces:
XMLReaderJDOMFactory
- Direct Known Subclasses:
AbstractReaderXSDFactory
,XMLReaderSchemaFactory
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:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractReaderSchemaFactory
(SAXParserFactory fac, Schema schema) XMLReader instances from this class will be configured to validate using the supplied Schema instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance.boolean
Does an XMLReader from this factory do more than just well-formed checks.
-
Constructor Details
-
AbstractReaderSchemaFactory
XMLReader instances from this class will be configured to validate using the supplied Schema instance.- Parameters:
fac
- The SAXParserFactory to use for creating XMLReader instances.schema
- The Schema to use for validation.
-
-
Method Details
-
createXMLReader
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 bySAXBuilder
.- Specified by:
createXMLReader
in interfaceXMLReaderJDOMFactory
- Returns:
- a new XMLReader
- Throws:
JDOMException
- if an XMLReader was not available.
-
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 interfaceXMLReaderJDOMFactory
- Returns:
- true if the XMLReader validates
-