Class XMLReaderFactory
java.lang.Object
org.eclipse.rdf4j.common.xml.XMLReaderFactory
Factory class for creating an XMLReader. This factory tries to use the system property 'org.xml.sax.driver', if that
fails it falls back on javax.xml.sax.parsers.SAXParserFactory. If the SAXParserFactory class can not be found (this
can happen when using a Java 1.3 or older), or the initialization using SAXParserFactory fails otherwise, the factory
falls back on the Xerces 2 SAX Parser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property for configuring the Apache Xercesdisallow-doctype-declfeature.static final StringSystem property for configuring the SAXexternal-general-entitiesfeature.static final StringSystem property for configuring the SAXexternal-parameter-entitiesfeature.static final StringSystem property for configuring the Apache Xercesload-external-dtdfeature.static final StringSystem property for configuringXMLConstants.FEATURE_SECURE_PROCESSING.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static XMLReader_createXMLReader(String name) static XMLReadercreates an org.xml.sax.XMLReader object.static XMLReadercreateXMLReader(String name) Creates an org.xml.sax.XMLReader object using the supplied name.
-
Field Details
-
XERCES_SAXPARSER
- See Also:
-
SECURE_PROCESSING_PROPERTY
System property for configuringXMLConstants.FEATURE_SECURE_PROCESSING.Defaults to
true.- See Also:
-
DISALLOW_DOCTYPE_DECL_PROPERTY
System property for configuring the Apache Xercesdisallow-doctype-declfeature.Defaults to
true.- See Also:
-
LOAD_EXTERNAL_DTD_PROPERTY
System property for configuring the Apache Xercesload-external-dtdfeature.Defaults to
false.- See Also:
-
EXTERNAL_GENERAL_ENTITIES_PROPERTY
System property for configuring the SAXexternal-general-entitiesfeature.Defaults to
false.- See Also:
-
EXTERNAL_PARAMETER_ENTITIES_PROPERTY
System property for configuring the SAXexternal-parameter-entitiesfeature.Defaults to
false.- See Also:
-
-
Constructor Details
-
XMLReaderFactory
public XMLReaderFactory()
-
-
Method Details
-
createXMLReader
creates an org.xml.sax.XMLReader object. The method first tries to create the XMLReader object specified in the 'org.xml.sax.driver' system property. If that fails, it tries to use java.xml.parsers.SAXParserFactory. If that also fails, it tries to initialize the Xerces 2 SAX parser. If that also fails, a SAXException is thrown.- Returns:
- an XMLReader
- Throws:
SAXException- when no default XMLReader class can be found or instantiated.
-
createXMLReader
Creates an org.xml.sax.XMLReader object using the supplied name.- Returns:
- an XMLReader
- Throws:
SAXException- when the supplied XMLReader class name can not be found or instantiated.
-
_createXMLReader
protected static XMLReader _createXMLReader(String name) throws ClassNotFoundException, ClassCastException, InstantiationException, IllegalAccessException
-