|
ModeShape Distribution 3.0.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.api.text.TextExtractor
public abstract class TextExtractor
An abstraction for components that are able to extract text content from an input stream.
| Nested Class Summary | |
|---|---|
protected static interface |
TextExtractor.BinaryOperation<T>
Interface which can be used by subclasses to process the input stream of a binary property. |
static interface |
TextExtractor.Context
Interface which provides additional information to the text extractors, during the extraction operation. |
static interface |
TextExtractor.Output
The interface passed to a TextExtractor to which the extractor should record all text content. |
| Constructor Summary | |
|---|---|
TextExtractor()
|
|
| Method Summary | ||
|---|---|---|
abstract void |
extractFrom(Binary binary,
TextExtractor.Output output,
TextExtractor.Context context)
Extract text from the given Binary, using the given output to record the results. |
|
protected Logger |
getLogger()
|
|
String |
getName()
|
|
protected
|
processStream(Binary binary,
TextExtractor.BinaryOperation<T> operation)
Allows subclasses to process the stream of binary value property in "safe" fashion, making sure the stream is closed at the end of the operation. |
|
void |
setLogger(Logger logger)
|
|
void |
setName(String name)
|
|
abstract boolean |
supportsMimeType(String mimeType)
Determine if this extractor is capable of processing content with the supplied MIME type. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextExtractor()
| Method Detail |
|---|
public abstract boolean supportsMimeType(String mimeType)
mimeType - the MIME type; never null
public abstract void extractFrom(Binary binary,
TextExtractor.Output output,
TextExtractor.Context context)
throws Exception
Binary, using the given output to record the results.
binary - the binary value that can be used in the extraction process; never nulloutput - the output from the sequencing operation; never nullcontext - the context for the sequencing operation; never null
Exception - if there is a problem during the extraction process
protected final <T> T processStream(Binary binary,
TextExtractor.BinaryOperation<T> operation)
throws Exception
T - the return type of the binary operationbinary - a Binary who is expected to contain a non-null binary value.operation - a TextExtractor.BinaryOperation which should work with the stream
Exception - if there is an error processing the streampublic final void setLogger(Logger logger)
protected final Logger getLogger()
public String getName()
public void setName(String name)
|
ModeShape Distribution 3.0.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||