Package org.jdom2.input.sax
Class XMLReaderSAX2Factory
- java.lang.Object
-
- org.jdom2.input.sax.XMLReaderSAX2Factory
-
- All Implemented Interfaces:
XMLReaderJDOMFactory
public class XMLReaderSAX2Factory extends java.lang.Object implements XMLReaderJDOMFactory
Create XMLReaders directly from the SAX2.0 API using a SAX Driver class name or the default SAX2.0 location process.Unless you have good reason to use this mechanism you should rather use the JAXP-based processes. Read the
package documentation
for other alternatives.- Author:
- Rolf Lear
- See Also:
org.jdom2.input.sax
-
-
Constructor Summary
Constructors Constructor Description XMLReaderSAX2Factory(boolean validate)
The required details for SAX2.0-based XMLReader creation.XMLReaderSAX2Factory(boolean validate, java.lang.String saxdriver)
The required details for SAX2.0-based XMLReader creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.xml.sax.XMLReader
createXMLReader()
Return a new XMLReader according to the implementation of this XMLReaderJDOMFactory instance.java.lang.String
getDriverClassName()
Get the SAX Driver class name used to boostrap XMLReaders.boolean
isValidating()
Does an XMLReader from this factory do more than just well-formed checks.
-
-
-
Constructor Detail
-
XMLReaderSAX2Factory
public XMLReaderSAX2Factory(boolean validate)
The required details for SAX2.0-based XMLReader creation.- Parameters:
validate
- whether to validate against the DocType- See Also:
XMLReaders.NONVALIDATING
,XMLReaders.DTDVALIDATING
,XMLReaders.XSDVALIDATING
-
XMLReaderSAX2Factory
public XMLReaderSAX2Factory(boolean validate, java.lang.String saxdriver)
The required details for SAX2.0-based XMLReader creation.- Parameters:
validate
- whether to validate against the DocTypesaxdriver
- The SAX2.0 Driver classname (null to use the SAX2.0 default parser searching algorithm - if you specify null you should probably be using JAXP anyway).- See Also:
XMLReaders.NONVALIDATING
,XMLReaders.DTDVALIDATING
,XMLReaders.XSDVALIDATING
-
-
Method Detail
-
createXMLReader
public org.xml.sax.XMLReader createXMLReader() throws JDOMException
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.
-
getDriverClassName
public java.lang.String getDriverClassName()
Get the SAX Driver class name used to boostrap XMLReaders.- Returns:
- The name of the SAX Driver class (null for SAX2 default class).
-
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
-
-