Class AbstractSPARQLXMLParser
- java.lang.Object
-
- org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
-
- org.eclipse.rdf4j.query.resultio.sparqlxml.AbstractSPARQLXMLParser
-
- All Implemented Interfaces:
QueryResultParser
,org.xml.sax.ErrorHandler
- Direct Known Subclasses:
SPARQLBooleanXMLParser
,SPARQLResultsXMLParser
,SPARQLXMLParserBase
public abstract class AbstractSPARQLXMLParser extends AbstractQueryResultParser implements org.xml.sax.ErrorHandler
Abstract base class for SPARQL Results XML Parsers.
-
-
Field Summary
Fields Modifier and Type Field Description private SimpleSAXParser
internalSAXParser
-
Fields inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
handler, valueFactory
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSPARQLXMLParser()
protected
AbstractSPARQLXMLParser(ValueFactory valueFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
error(org.xml.sax.SAXParseException exception)
void
fatalError(org.xml.sax.SAXParseException exception)
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 inAbstractQueryResultParser.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 inAbstractQueryResultParser.getParserConfig()
, as XML parser properties usingXMLReader.setProperty(String, Object)
java.util.Collection<RioSetting<?>>
getSupportedSettings()
void
parseQueryResult(java.io.InputStream in)
Parse the query results out of the givenInputStream
into the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler)
.protected boolean
parseQueryResultInternal(java.io.InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple)
protected void
reportWarning(java.lang.String msg)
void
warning(org.xml.sax.SAXParseException exception)
-
Methods inherited from class org.eclipse.rdf4j.query.resultio.AbstractQueryResultParser
getParseErrorListener, getParseLocationListener, getParserConfig, set, setParseErrorListener, setParseLocationListener, setParserConfig, setQueryResultHandler, setValueFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.query.resultio.QueryResultParser
getQueryResultFormat
-
-
-
-
Field Detail
-
internalSAXParser
private SimpleSAXParser internalSAXParser
-
-
Constructor Detail
-
AbstractSPARQLXMLParser
protected AbstractSPARQLXMLParser()
-
AbstractSPARQLXMLParser
protected AbstractSPARQLXMLParser(ValueFactory valueFactory)
-
-
Method Detail
-
parseQueryResult
public void parseQueryResult(java.io.InputStream in) throws java.io.IOException, QueryResultParseException, QueryResultHandlerException
Description copied from interface:QueryResultParser
Parse the query results out of the givenInputStream
into the handler setup usingQueryResultParser.setQueryResultHandler(QueryResultHandler)
.- Specified by:
parseQueryResult
in interfaceQueryResultParser
- Parameters:
in
- TheInputStream
to parse the results from.- Throws:
java.io.IOException
- If there is an exception from the InputStream.QueryResultParseException
- If the query results are not parsable by this parser.QueryResultHandlerException
- If theQueryResultHandler
set inQueryResultParser.setQueryResultHandler(QueryResultHandler)
throws an exception.
-
parseQueryResultInternal
protected boolean parseQueryResultInternal(java.io.InputStream in, boolean attemptParseBoolean, boolean attemptParseTuple) throws java.io.IOException, QueryResultParseException, QueryResultHandlerException
- Throws:
java.io.IOException
QueryResultParseException
QueryResultHandlerException
-
reportWarning
protected void reportWarning(java.lang.String msg)
-
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 inAbstractQueryResultParser.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 inAbstractQueryResultParser.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)
.
-
getSupportedSettings
public java.util.Collection<RioSetting<?>> getSupportedSettings()
- Specified by:
getSupportedSettings
in interfaceQueryResultParser
- Overrides:
getSupportedSettings
in classAbstractQueryResultParser
- Returns:
- A collection of
RioSetting
s that are supported by this QueryResultParser.
-
warning
public void warning(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
warning
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
error
public void error(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
error
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.sax.SAXException
- Specified by:
fatalError
in interfaceorg.xml.sax.ErrorHandler
- Throws:
org.xml.sax.SAXException
-
-