Package org.jdom2.input.sax
Class XMLReaderXSDFactory
java.lang.Object
org.jdom2.input.sax.AbstractReaderSchemaFactory
org.jdom2.input.sax.AbstractReaderXSDFactory
org.jdom2.input.sax.XMLReaderXSDFactory
- All Implemented Interfaces:
XMLReaderJDOMFactory
This XMLReaderJDOMFactory class returns XMLReaders configured to validate
against the supplied XML Schema (XSD) instance. The SAX Parser is obtained through
the JAXP process.
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jdom2.input.sax.AbstractReaderXSDFactory
AbstractReaderXSDFactory.SchemaFactoryProvider
-
Constructor Summary
ConstructorsConstructorDescriptionXMLReaderXSDFactory
(File... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from File references.XMLReaderXSDFactory
(String... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references.XMLReaderXSDFactory
(String factoryClassName, ClassLoader classloader, File... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from File references, and use the specified JAXP SAXParserFactory.XMLReaderXSDFactory
(String factoryClassName, ClassLoader classloader, String... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references, and use the specified JAXP SAXParserFactory.XMLReaderXSDFactory
(String factoryClassName, ClassLoader classloader, URL... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references, and use the specified JAXP SAXParserFactory.XMLReaderXSDFactory
(String factoryClassName, ClassLoader classloader, Source... sources) Create an XML Schema validating XMLReader factory using one or more XSD sources from Transform Source references, and use the specified JAXP SAXParserFactory.XMLReaderXSDFactory
(URL... systemid) Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references.XMLReaderXSDFactory
(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 Details
-
XMLReaderXSDFactory
Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references.- Parameters:
systemid
- 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.
-
XMLReaderXSDFactory
public XMLReaderXSDFactory(String factoryClassName, ClassLoader classloader, String... systemid) throws JDOMException Create an XML Schema validating XMLReader factory using one or more XSD sources from SystemID references, and use the specified JAXP SAXParserFactory.- Parameters:
factoryClassName
- The name of the SAXParserFactory class to useclassloader
- The classLoader to use for loading the SAXParserFactory.systemid
- 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.- Since:
- 2.0.3
-
XMLReaderXSDFactory
Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references.- Parameters:
systemid
- 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.
-
XMLReaderXSDFactory
public XMLReaderXSDFactory(String factoryClassName, ClassLoader classloader, URL... systemid) throws JDOMException Create an XML Schema validating XMLReader factory using one or more XSD sources from URL references, and use the specified JAXP SAXParserFactory.- Parameters:
factoryClassName
- The name of the SAXParserFactory class to useclassloader
- The classLoader to use for loading the SAXParserFactory.systemid
- 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.- Since:
- 2.0.3
-
XMLReaderXSDFactory
Create an XML Schema validating XMLReader factory using one or more XSD sources from File references.- Parameters:
systemid
- 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.
-
XMLReaderXSDFactory
public XMLReaderXSDFactory(String factoryClassName, ClassLoader classloader, File... systemid) throws JDOMException Create an XML Schema validating XMLReader factory using one or more XSD sources from File references, and use the specified JAXP SAXParserFactory.- Parameters:
factoryClassName
- The name of the SAXParserFactory class to useclassloader
- The classLoader to use for loading the SAXParserFactory.systemid
- 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.- Since:
- 2.0.3
-
XMLReaderXSDFactory
Create an XML Schema validating XMLReader factory using one or more XSD sources from Transform Source references.- Parameters:
sources
- 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.
-
XMLReaderXSDFactory
public XMLReaderXSDFactory(String factoryClassName, ClassLoader classloader, Source... sources) throws JDOMException Create an XML Schema validating XMLReader factory using one or more XSD sources from Transform Source references, and use the specified JAXP SAXParserFactory.- Parameters:
factoryClassName
- The name of the SAXParserFactory class to useclassloader
- The classLoader to use for loading the SAXParserFactory.sources
- 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.- Since:
- 2.0.3
-