Class SPARQLResultsSAXParser
- java.lang.Object
-
- org.eclipse.rdf4j.common.xml.SimpleSAXAdapter
-
- org.eclipse.rdf4j.query.resultio.sparqlxml.SPARQLResultsSAXParser
-
- All Implemented Interfaces:
SimpleSAXListener
class SPARQLResultsSAXParser extends SimpleSAXAdapter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSPARQLResultsSAXParser.TripleContainer
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>bindingNamesThe variable names that are specified in the header.private java.lang.StringcurrentBindingNameThe most recently parsed binding name.private MapBindingSetcurrentSolutionThe bound variables for the current result.private ValuecurrentValueThe most recently parsed value.private QueryResultHandlerhandlerprivate org.slf4j.Loggerloggerprivate java.util.Deque<SPARQLResultsSAXParser.TripleContainer>tripleStackstack for handling nested RDF-star triplesprivate ValueFactoryvalueFactory
-
Constructor Summary
Constructors Constructor Description SPARQLResultsSAXParser(ValueFactory valueFactory, QueryResultHandler handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendDocument()Notifies the listener that the parser has finished parsing.voidendTag(java.lang.String tagName)Reports an end tag to the listener.voidstartDocument()Notifies the listener that the parser has started parsing.voidstartTag(java.lang.String tagName, java.util.Map<java.lang.String,java.lang.String> atts, java.lang.String text)Reports a start tag to the listener.
-
-
-
Field Detail
-
logger
private final org.slf4j.Logger logger
-
bindingNames
private java.util.List<java.lang.String> bindingNames
The variable names that are specified in the header.
-
currentBindingName
private java.lang.String currentBindingName
The most recently parsed binding name.
-
currentValue
private Value currentValue
The most recently parsed value.
-
currentSolution
private MapBindingSet currentSolution
The bound variables for the current result.
-
valueFactory
private final ValueFactory valueFactory
-
handler
private final QueryResultHandler handler
-
tripleStack
private final java.util.Deque<SPARQLResultsSAXParser.TripleContainer> tripleStack
stack for handling nested RDF-star triples
-
-
Constructor Detail
-
SPARQLResultsSAXParser
public SPARQLResultsSAXParser(ValueFactory valueFactory, QueryResultHandler handler)
-
-
Method Detail
-
startDocument
public void startDocument() throws org.xml.sax.SAXExceptionDescription copied from interface:SimpleSAXListenerNotifies the listener that the parser has started parsing.- Specified by:
startDocumentin interfaceSimpleSAXListener- Overrides:
startDocumentin classSimpleSAXAdapter- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionDescription copied from interface:SimpleSAXListenerNotifies the listener that the parser has finished parsing.- Specified by:
endDocumentin interfaceSimpleSAXListener- Overrides:
endDocumentin classSimpleSAXAdapter- Throws:
org.xml.sax.SAXException
-
startTag
public void startTag(java.lang.String tagName, java.util.Map<java.lang.String,java.lang.String> atts, java.lang.String text) throws org.xml.sax.SAXExceptionDescription copied from interface:SimpleSAXListenerReports a start tag to the listener. The method call reports the tag's name, the attributes that were found in the start tag and any text that was found after the start tag.- Specified by:
startTagin interfaceSimpleSAXListener- Overrides:
startTagin classSimpleSAXAdapter- Parameters:
tagName- The tag name.atts- A map containing key-value-pairs representing the attributes that were found in the start tag.text- The text immediately following the start tag, or an empty string if the start tag was followed by a nested start tag or if no text (other than whitespace) was found between start- and end tag.- Throws:
org.xml.sax.SAXException
-
endTag
public void endTag(java.lang.String tagName) throws org.xml.sax.SAXExceptionDescription copied from interface:SimpleSAXListenerReports an end tag to the listener.- Specified by:
endTagin interfaceSimpleSAXListener- Overrides:
endTagin classSimpleSAXAdapter- Parameters:
tagName- The tag name.- Throws:
org.xml.sax.SAXException
-
-