Class RDFRemover
- java.lang.Object
-
- org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler
-
- org.eclipse.rdf4j.repository.util.RDFRemover
-
- All Implemented Interfaces:
RDFHandler
public class RDFRemover extends AbstractRDFHandler
An RDFHandler that removes RDF data from a repository.
-
-
Field Summary
Fields Modifier and Type Field Description private RepositoryConnectionconThe connection to use for the removal operations.private ResourcecontextThe context to remove the statements from; null to indicate the null context.private booleanenforceContextFlag indicating whether the context specified for this RDFRemover should be enforced upon all reported statements.
-
Constructor Summary
Constructors Constructor Description RDFRemover(RepositoryConnection con)Creates a new RDFRemover object that removes the data from the default context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenforceContext(Resource context)Enforces the supplied context upon all statements that are reported to this RDFRemover.booleanenforcesContext()Checks whether this RDFRemover enforces its context upon all statements that are reported to it.ResourcegetContext()Gets the context identifier that this RDFRemover enforces upon all statements that are reported to it (in case enforcesContext() returns true).voidhandleStatement(Statement st)Handles a statement.-
Methods inherited from class org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler
endRDF, handleComment, handleNamespace, startRDF
-
-
-
-
Field Detail
-
con
private final RepositoryConnection con
The connection to use for the removal operations.
-
enforceContext
private boolean enforceContext
Flag indicating whether the context specified for this RDFRemover should be enforced upon all reported statements.
-
context
private Resource context
The context to remove the statements from; null to indicate the null context. This context value is used when enforceContext is set to true.
-
-
Constructor Detail
-
RDFRemover
public RDFRemover(RepositoryConnection con)
Creates a new RDFRemover object that removes the data from the default context.- Parameters:
con- The connection to use for the removal operations.
-
-
Method Detail
-
enforceContext
public void enforceContext(Resource context)
Enforces the supplied context upon all statements that are reported to this RDFRemover.- Parameters:
context- A Resource identifying the context, or null for the null context.
-
enforcesContext
public boolean enforcesContext()
Checks whether this RDFRemover enforces its context upon all statements that are reported to it.- Returns:
- true if it enforces its context, false otherwise.
-
getContext
public Resource getContext()
Gets the context identifier that this RDFRemover enforces upon all statements that are reported to it (in case enforcesContext() returns true).- Returns:
- A Resource identifying the context, or null if the null context is enforced.
-
handleStatement
public void handleStatement(Statement st) throws RDFHandlerException
Description copied from interface:RDFHandlerHandles a statement.- Specified by:
handleStatementin interfaceRDFHandler- Overrides:
handleStatementin classAbstractRDFHandler- Parameters:
st- The statement.- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-
-