Package org.eclipse.rdf4j.rio.helpers
Class XMLReaderBasedParser
- java.lang.Object
-
- org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
-
- org.eclipse.rdf4j.rio.helpers.XMLReaderBasedParser
-
- All Implemented Interfaces:
RDFParser
- Direct Known Subclasses:
RDFXMLParser
,TriXParser
public abstract class XMLReaderBasedParser extends AbstractRDFParser
Base class for Rio parsers that are based on a SAXXMLReader
.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Set<RioSetting<java.lang.Boolean>>
compulsoryXmlFeatureSettings
-
Fields inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
rdfHandler, valueFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
XMLReaderBasedParser(ValueFactory f)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<RioSetting<java.lang.Boolean>>
getCompulsoryXmlFeatureSettings()
Returns a collection of settings that will always be set as XML parser features usingXMLReader.setFeature(String, boolean)
.java.util.Collection<RioSetting<?>>
getCompulsoryXmlPropertySettings()
Returns a collection of settings that will always be set as XML parser properties usingXMLReader.setProperty(String, Object)
java.util.Collection<RioSetting<java.lang.Boolean>>
getOptionalXmlFeatureSettings()
Returns a collection of settings that will be used, if set inAbstractRDFParser.getParserConfig()
, as XML parser features usingXMLReader.setFeature(String, boolean)
.java.util.Collection<RioSetting<?>>
getOptionalXmlPropertySettings()
Returns a collection of settings that will be used, if set inAbstractRDFParser.getParserConfig()
, as XML parser properties usingXMLReader.setProperty(String, Object)
protected org.xml.sax.XMLReader
getXMLReader()
Creates an XML Reader configured using the current parser settings.-
Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFParser
clear, clearBNodeIDMap, createBNode, createBNode, createLiteral, createLiteral, createNode, createNode, createStatement, createStatement, createURI, getNamespace, getParseErrorListener, getParseLocationListener, getParserConfig, getRDFHandler, getSupportedSettings, initializeNamespaceTableFromConfiguration, preserveBNodeIDs, reportError, reportError, reportError, reportError, reportError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportFatalError, reportLocation, reportWarning, reportWarning, resolveURI, set, setBaseURI, setBaseURI, setNamespace, setParseErrorListener, setParseLocationListener, setParserConfig, setPreserveBNodeIDs, setRDFHandler, setValueFactory
-
-
-
-
Field Detail
-
compulsoryXmlFeatureSettings
private static final java.util.Set<RioSetting<java.lang.Boolean>> compulsoryXmlFeatureSettings
-
-
Constructor Detail
-
XMLReaderBasedParser
protected XMLReaderBasedParser(ValueFactory f)
-
-
Method Detail
-
getCompulsoryXmlPropertySettings
public java.util.Collection<RioSetting<?>> getCompulsoryXmlPropertySettings()
Returns a collection of settings that will always be set as XML parser properties usingXMLReader.setProperty(String, Object)
Subclasses can override this to specify more supported settings.
- Returns:
- A collection of
RioSetting
s that indicate which properties will always be setup usingXMLReader.setProperty(String, Object)
.
-
getCompulsoryXmlFeatureSettings
public java.util.Collection<RioSetting<java.lang.Boolean>> getCompulsoryXmlFeatureSettings()
Returns a collection of settings that will always be set as XML parser features usingXMLReader.setFeature(String, boolean)
.Subclasses can override this to specify more supported settings.
- Returns:
- A collection of
RioSetting
s that indicate which boolean settings will always be setup usingXMLReader.setFeature(String, boolean)
.
-
getOptionalXmlPropertySettings
public java.util.Collection<RioSetting<?>> getOptionalXmlPropertySettings()
Returns a collection of settings that will be used, if set inAbstractRDFParser.getParserConfig()
, as XML parser properties usingXMLReader.setProperty(String, Object)
Subclasses can override this to specify more supported settings.
- Returns:
- A collection of
RioSetting
s that indicate which properties can be setup usingXMLReader.setProperty(String, Object)
.
-
getOptionalXmlFeatureSettings
public java.util.Collection<RioSetting<java.lang.Boolean>> getOptionalXmlFeatureSettings()
Returns a collection of settings that will be used, if set inAbstractRDFParser.getParserConfig()
, as XML parser features usingXMLReader.setFeature(String, boolean)
.Subclasses can override this to specify more supported settings.
- Returns:
- A collection of
RioSetting
s that indicate which boolean settings can be setup usingXMLReader.setFeature(String, boolean)
.
-
getXMLReader
protected org.xml.sax.XMLReader getXMLReader() throws org.xml.sax.SAXException
Creates an XML Reader configured using the current parser settings.- Returns:
- a configured
XMLReader
- Throws:
org.xml.sax.SAXException
- if an error occurs during configuration.
-
-