public abstract class AbstractGraphListener extends Object implements org.apache.jena.graph.GraphListener
GraphListener.notifyAddTriple(org.apache.jena.graph.Graph, org.apache.jena.graph.Triple) and
GraphListener.notifyDeleteTriple(org.apache.jena.graph.Graph, org.apache.jena.graph.Triple) to
reduce the implementation burden of subclasses.
All of the bulk operations are forwarded to
notifyAddIterator(org.apache.jena.graph.Graph, java.util.Iterator<org.apache.jena.graph.Triple>) and
notifyDeleteIterator(org.apache.jena.graph.Graph, java.util.Iterator<org.apache.jena.graph.Triple>).
So subclasses can override those two methods to
modify all the bulk operations, except the removeAll
ones.
For the removeAll operations, subclasses should implement
notifyRemoveAll(Graph, Triple),
this is only called by the default implementation
of notifyEvent(Graph, Object).| Constructor and Description |
|---|
AbstractGraphListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
notifyAddArray(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Triple[] triples) |
void |
notifyAddGraph(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Graph added) |
void |
notifyAddIterator(org.apache.jena.graph.Graph g,
Iterator<org.apache.jena.graph.Triple> it) |
void |
notifyAddList(org.apache.jena.graph.Graph g,
List<org.apache.jena.graph.Triple> triples) |
void |
notifyDeleteArray(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Triple[] triples) |
void |
notifyDeleteGraph(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Graph removed) |
void |
notifyDeleteIterator(org.apache.jena.graph.Graph g,
Iterator<org.apache.jena.graph.Triple> it) |
void |
notifyDeleteList(org.apache.jena.graph.Graph g,
List<org.apache.jena.graph.Triple> list) |
void |
notifyEvent(org.apache.jena.graph.Graph source,
Object value)
value is usually a GraphEvents. |
protected abstract void |
notifyRemoveAll(org.apache.jena.graph.Graph source,
org.apache.jena.graph.Triple pattern)
Called after a removeAll modification.
|
public void notifyAddArray(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Triple[] triples)
notifyAddArray in interface org.apache.jena.graph.GraphListenerpublic void notifyAddGraph(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Graph added)
notifyAddGraph in interface org.apache.jena.graph.GraphListenerpublic void notifyAddIterator(org.apache.jena.graph.Graph g,
Iterator<org.apache.jena.graph.Triple> it)
notifyAddIterator in interface org.apache.jena.graph.GraphListenerpublic void notifyAddList(org.apache.jena.graph.Graph g,
List<org.apache.jena.graph.Triple> triples)
notifyAddList in interface org.apache.jena.graph.GraphListenerpublic void notifyDeleteArray(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Triple[] triples)
notifyDeleteArray in interface org.apache.jena.graph.GraphListenerpublic void notifyDeleteGraph(org.apache.jena.graph.Graph g,
org.apache.jena.graph.Graph removed)
notifyDeleteGraph in interface org.apache.jena.graph.GraphListenerpublic void notifyDeleteIterator(org.apache.jena.graph.Graph g,
Iterator<org.apache.jena.graph.Triple> it)
notifyDeleteIterator in interface org.apache.jena.graph.GraphListenerpublic void notifyDeleteList(org.apache.jena.graph.Graph g,
List<org.apache.jena.graph.Triple> list)
notifyDeleteList in interface org.apache.jena.graph.GraphListenerpublic void notifyEvent(org.apache.jena.graph.Graph source,
Object value)
value is usually a GraphEvents.
Special attention is drawn to GraphEvents.removeAll
and events whose GraphEvents.getTitle() is "remove"
(see GraphEvents.remove(Node, Node, Node). These correspond
to the operations for removeAll, and remove, respectively.
Unlike other notifications, the listener cannot tell which triples
have been modified, since they have already been deleted by the time
this event is sent, and the event does not include a record of them.
This default implementation maps these two events to
notifyRemoveAll(Graph, Triple) calls.notifyEvent in interface org.apache.jena.graph.GraphListenerprotected abstract void notifyRemoveAll(org.apache.jena.graph.Graph source,
org.apache.jena.graph.Triple pattern)
notifyEvent(Graph, Object) for explanation
of this method.source - pattern - The pattern of triples being removed, often Triple.ANY.Copyright © 2017 TopQuadrant, Inc.. All rights reserved.