org.apache.jackrabbit.core.query.lucene
Class LazyTextExtractorField

java.lang.Object
  extended by org.apache.lucene.document.AbstractField
      extended by org.apache.jackrabbit.core.query.lucene.LazyTextExtractorField
All Implemented Interfaces:
Serializable, org.apache.lucene.document.Fieldable

public class LazyTextExtractorField
extends org.apache.lucene.document.AbstractField

LazyTextExtractorField implements a Lucene field with a String value that is lazily initialized from a given Reader. In addition this class provides a method to find out whether the purpose of the reader is to extract text and whether the extraction process is already finished.

See Also:
isExtractorFinished(), Serialized Form

Field Summary
 
Fields inherited from class org.apache.lucene.document.AbstractField
binaryLength, binaryOffset, boost, fieldsData, isBinary, isCompressed, isIndexed, isStored, isTokenized, lazy, name, omitNorms, omitTf, storeOffsetWithTermVector, storePositionWithTermVector, storeTermVector
 
Constructor Summary
LazyTextExtractorField(org.apache.tika.parser.Parser parser, InternalValue value, org.apache.tika.metadata.Metadata metadata, Executor executor, boolean highlighting, int maxFieldLength)
          Creates a new LazyTextExtractorField with the given name.
 
Method Summary
 byte[] binaryValue()
           
 void dispose()
          Releases all resources associated with this field.
 boolean isExtractorFinished()
          Checks whether the text extraction task has finished.
 Reader readerValue()
           
 String stringValue()
          Returns the extracted text.
 org.apache.lucene.analysis.TokenStream tokenStreamValue()
           
 
Methods inherited from class org.apache.lucene.document.AbstractField
getBinaryLength, getBinaryOffset, getBinaryValue, getBinaryValue, getBoost, getOmitNorms, getOmitTf, isBinary, isCompressed, isIndexed, isLazy, isStored, isStoreOffsetWithTermVector, isStorePositionWithTermVector, isTermVectorStored, isTokenized, name, setBoost, setOmitNorms, setOmitTf, setStoreTermVector, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyTextExtractorField

public LazyTextExtractorField(org.apache.tika.parser.Parser parser,
                              InternalValue value,
                              org.apache.tika.metadata.Metadata metadata,
                              Executor executor,
                              boolean highlighting,
                              int maxFieldLength)
Creates a new LazyTextExtractorField with the given name.

Parameters:
name - the name of the field.
reader - the reader where to obtain the string from.
highlighting - set to true to enable result highlighting support
Method Detail

stringValue

public String stringValue()
Returns the extracted text. This method blocks until the text extraction task has been completed.

Returns:
the string value of this field

readerValue

public Reader readerValue()
Returns:
always null

binaryValue

public byte[] binaryValue()
Returns:
always null

tokenStreamValue

public org.apache.lucene.analysis.TokenStream tokenStreamValue()
Returns:
always null

isExtractorFinished

public boolean isExtractorFinished()
Checks whether the text extraction task has finished.

Returns:
true if the extracted text is available

dispose

public void dispose()
Releases all resources associated with this field.



Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.