|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.filter.ExtractionContextBlocker
public class ExtractionContextBlocker
A wrapper around a TripleHandler
that can block and unblock
calls to the handler, either for the entire document, or for
individual ExtractionContext
s. A document is initially
blocked and must be explicitly unblocked. Contexts are initially
unblocked and must be explicitly blocked. Unblocking a document
unblocks all contexts as well.
This class it thread-safe.
Constructor Summary | |
---|---|
ExtractionContextBlocker(TripleHandler wrapped)
|
Method Summary | |
---|---|
void |
blockContext(ExtractionContext context)
|
void |
close()
Will be called last and exactly once. |
void |
closeContext(ExtractionContext context)
Informs the handler that no more triples will come from a previously opened context. |
void |
endDocument(org.openrdf.model.URI documentURI)
Informs the handler that the end of the document has been reached. |
boolean |
isDocBlocked()
|
void |
openContext(ExtractionContext context)
Informs the handler that a new context has been established. |
void |
receiveNamespace(String prefix,
String uri,
ExtractionContext context)
Invoked with a currently open context, notifies the detection of a namespace. |
void |
receiveTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI g,
ExtractionContext context)
Invoked with a currently open context, notifies the detection of a triple. |
void |
setContentLength(long contentLength)
Sets the length of the content to be processed. |
void |
startDocument(org.openrdf.model.URI documentURI)
|
void |
unblockContext(ExtractionContext context)
|
void |
unblockDocument()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtractionContextBlocker(TripleHandler wrapped)
Method Detail |
---|
public boolean isDocBlocked()
public void blockContext(ExtractionContext context)
public void unblockContext(ExtractionContext context)
public void startDocument(org.openrdf.model.URI documentURI) throws TripleHandlerException
startDocument
in interface TripleHandler
TripleHandlerException
public void openContext(ExtractionContext context) throws TripleHandlerException
TripleHandler
openContext
in interface TripleHandler
TripleHandlerException
public void closeContext(ExtractionContext context)
TripleHandler
closeContext
in interface TripleHandler
context
- the context to be closed.public void unblockDocument()
public void receiveTriple(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, org.openrdf.model.URI g, ExtractionContext context) throws TripleHandlerException
TripleHandler
receiveTriple
in interface TripleHandler
s
- triple subject, cannot be null
.p
- triple predicate, cannot be null
.o
- triple object, cannot be null
.g
- triple graph, can be null
.context
- extraction context.
TripleHandlerException
public void receiveNamespace(String prefix, String uri, ExtractionContext context) throws TripleHandlerException
TripleHandler
receiveNamespace
in interface TripleHandler
prefix
- namespace prefix.uri
- namespace URI.context
- namespace context.
TripleHandlerException
public void close() throws TripleHandlerException
TripleHandler
close
in interface TripleHandler
TripleHandlerException
public void endDocument(org.openrdf.model.URI documentURI) throws TripleHandlerException
TripleHandler
endDocument
in interface TripleHandler
documentURI
- document URI.
TripleHandlerException
public void setContentLength(long contentLength)
TripleHandler
setContentLength
in interface TripleHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |