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(String name, Reader reader, boolean store, boolean withOffsets)
          Creates a new LazyTextExtractorField with the given name.
 
Method Summary
 byte[] binaryValue()
           
 void dispose()
          Disposes this field and closes the underlying reader.
 boolean isExtractorFinished()
           
 Reader readerValue()
           
 String stringValue()
           
 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(String name,
                              Reader reader,
                              boolean store,
                              boolean withOffsets)
Creates a new LazyTextExtractorField with the given name.

Parameters:
name - the name of the field.
reader - the reader where to obtain the string from.
store - when set true the string value is stored in the index.
withOffsets - when set true a term vector with offsets is written into the index.
Method Detail

stringValue

public String stringValue()
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()
Returns:
true if the underlying reader is ready to provide extracted text.

dispose

public void dispose()
             throws IOException
Disposes this field and closes the underlying reader.

Throws:
IOException - if an error occurs while closing the reader.


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