Package org.jdom2.input.sax
Class AbstractReaderXSDFactory
- java.lang.Object
-
- org.jdom2.input.sax.AbstractReaderSchemaFactory
-
- org.jdom2.input.sax.AbstractReaderXSDFactory
-
- All Implemented Interfaces:
XMLReaderJDOMFactory
- Direct Known Subclasses:
XMLReaderXSDFactory
public class AbstractReaderXSDFactory extends AbstractReaderSchemaFactory
This AbstractReaderJDOMFactory class returns XMLReaders configured to validate against the supplied XML Schema (XSD) instance.This class has var-arg constructors, accepting potentially many XSD sources. It is just as simple though to have a single source:
File xsdfile = new File("schema.xsd"); XMLReaderJDOMFactory schemafac = new XMLReaderXSDFactory(xsdfile); SAXBuilder builder = new SAXBuilder(schemafac); File xmlfile = new File("data.xml"); Document validdoc = builder.build(xmlfile);
- Author:
- Rolf Lear
- See Also:
org.jdom2.input.sax
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
AbstractReaderXSDFactory.SchemaFactoryProvider
Simple interface makes it easier to pass logic around in static methods.
-
Constructor Summary
Constructors Constructor Description AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.io.File... systemid)
Create an XML Schema validating XMLReader factory using one or more XSD sources from File references.AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.lang.String... systemid)
Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references.AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.net.URL... systemid)
Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references.AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, javax.xml.transform.Source... sources)
Create an XML Schema validating XMLReader factory using one or more XSD sources from Transform Source references.
-
Method Summary
-
Methods inherited from class org.jdom2.input.sax.AbstractReaderSchemaFactory
createXMLReader, isValidating
-
-
-
-
Constructor Detail
-
AbstractReaderXSDFactory
public AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.lang.String... systemid) throws JDOMException
Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references.- Parameters:
fac
- The SAXParserFactory used to create the XMLReader instances.sfp
- The SchemaFactoryProvider instance that gives us Schema Factoriessystemid
- The var-arg array of at least one SystemID reference (URL) to locate the XSD's used to validate- Throws:
JDOMException
- If the Schemas could not be loaded from the SystemIDs This will wrap a SAXException that contains the actual fault.
-
AbstractReaderXSDFactory
public AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.net.URL... systemid) throws JDOMException
Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references.- Parameters:
fac
- The SAXParserFactory used to create the XMLReader instances.sfp
- The SchemaFactoryProvider instance that gives us Schema Factoriessystemid
- The var-arg array of at least one SystemID reference (URL) to locate the XSD's used to validate- Throws:
JDOMException
- If the Schemas could not be loaded from the SystemIDs This will wrap a SAXException that contains the actual fault.
-
AbstractReaderXSDFactory
public AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, java.io.File... systemid) throws JDOMException
Create an XML Schema validating XMLReader factory using one or more XSD sources from File references.- Parameters:
fac
- The SAXParserFactory used to create the XMLReader instances.sfp
- The SchemaFactoryProvider instance that gives us Schema Factoriessystemid
- The var-arg array of at least one SystemID reference (File) to locate the XSD's used to validate- Throws:
JDOMException
- If the Schemas could not be loaded from the SystemIDs This will wrap a SAXException that contains the actual fault.
-
AbstractReaderXSDFactory
public AbstractReaderXSDFactory(javax.xml.parsers.SAXParserFactory fac, AbstractReaderXSDFactory.SchemaFactoryProvider sfp, javax.xml.transform.Source... sources) throws JDOMException
Create an XML Schema validating XMLReader factory using one or more XSD sources from Transform Source references.- Parameters:
fac
- The SAXParserFactory used to create the XMLReader instances.sfp
- The SchemaFactoryProvider instance that gives us Schema Factoriessources
- The var-arg array of at least one transform Source reference to locate the XSD's used to validate- Throws:
JDOMException
- If the Schemas could not be loaded from the Sources This will wrap a SAXException that contains the actual fault.
-
-