Class TransactionSAXParser
- java.lang.Object
-
- org.eclipse.rdf4j.common.xml.SimpleSAXAdapter
-
- org.eclipse.rdf4j.http.protocol.transaction.TransactionSAXParser
-
- All Implemented Interfaces:
SimpleSAXListener
class TransactionSAXParser extends SimpleSAXAdapter
Parses an RDF transaction document into a collection ofTransactionOperationobjects.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Binding>bindingsprivate SimpleDatasetcurrentDatasetprivate SPARQLUpdateOperationcurrentSPARQLUpdateprivate java.util.List<Value>parsedValuesprotected java.util.Collection<TransactionOperation>txnprivate ValueFactoryvalueFactory
-
Constructor Summary
Constructors Constructor Description TransactionSAXParser()TransactionSAXParser(ValueFactory valueFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private TransactionOperationcreateAddStatementOperation()private TransactionOperationcreateClearOperation()private Resource[]createContexts(int startIdx)private TransactionOperationcreateRemoveStatementsOperation()voidendTag(java.lang.String tagName)Reports an end tag to the listener.java.util.Collection<TransactionOperation>getTxn()get the parsed transactionvoidstartDocument()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.-
Methods inherited from class org.eclipse.rdf4j.common.xml.SimpleSAXAdapter
endDocument
-
-
-
-
Field Detail
-
valueFactory
private final ValueFactory valueFactory
-
txn
protected java.util.Collection<TransactionOperation> txn
-
parsedValues
private final java.util.List<Value> parsedValues
-
bindings
private java.util.List<Binding> bindings
-
currentSPARQLUpdate
private SPARQLUpdateOperation currentSPARQLUpdate
-
currentDataset
private SimpleDataset currentDataset
-
-
Constructor Detail
-
TransactionSAXParser
public TransactionSAXParser()
-
TransactionSAXParser
public TransactionSAXParser(ValueFactory valueFactory)
-
-
Method Detail
-
getTxn
public java.util.Collection<TransactionOperation> getTxn()
get the parsed transaction- Returns:
- the parsed transaction
-
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
-
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
-
createClearOperation
private TransactionOperation createClearOperation() throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createAddStatementOperation
private TransactionOperation createAddStatementOperation() throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createRemoveStatementsOperation
private TransactionOperation createRemoveStatementsOperation() throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
createContexts
private Resource[] createContexts(int startIdx) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
-