Package org.jdom2.input.sax
Class XMLReaderJAXPFactory
- java.lang.Object
-
- org.jdom2.input.sax.XMLReaderJAXPFactory
-
- All Implemented Interfaces:
XMLReaderJDOMFactory
public class XMLReaderJAXPFactory extends java.lang.Object implements XMLReaderJDOMFactory
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
XMLReadersenumeration, or use one of the simple constructors onXMLReaderXSDFactoryorXMLReaderSchemaFactory.See the documentation for
SAXParserFactoryfor the details on what the factoryClassName and classLoader should be.- Since:
- 2.0.3
- Author:
- Rolf Lear
- See Also:
org.jdom2.input.sax
-
-
Constructor Summary
Constructors Constructor Description XMLReaderJAXPFactory(java.lang.String factoryClassName, java.lang.ClassLoader classLoader, boolean dtdvalidate)Create an XMLReaderJAXPFactory using the specified factory name, classloader, and dtdvalidating flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xml.sax.XMLReadercreateXMLReader()Return a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance.booleanisValidating()Does an XMLReader from this factory do more than just well-formed checks.
-
-
-
Constructor Detail
-
XMLReaderJAXPFactory
public XMLReaderJAXPFactory(java.lang.String factoryClassName, java.lang.ClassLoader classLoader, boolean dtdvalidate)Create an XMLReaderJAXPFactory using the specified factory name, classloader, and dtdvalidating flag.- Parameters:
factoryClassName- The name of the implementation to use for the SAXParserFactory.classLoader- The classloader to use for locating the SAXParserFactory (may be null).dtdvalidate- Whether this should create DTD Validating XMLReaders.
-
-
Method Detail
-
createXMLReader
public org.xml.sax.XMLReader createXMLReader() throws JDOMExceptionDescription copied from interface:XMLReaderJDOMFactoryReturn 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:
createXMLReaderin interfaceXMLReaderJDOMFactory- Returns:
- a new XMLReader
- Throws:
JDOMException- if an XMLReader was not available.
-
isValidating
public boolean isValidating()
Description copied from interface:XMLReaderJDOMFactoryDoes an XMLReader from this factory do more than just well-formed checks.- Specified by:
isValidatingin interfaceXMLReaderJDOMFactory- Returns:
- true if the XMLReader validates
-
-