org.apache.jackrabbit.core.query.lucene
Class LazyTextExtractorField
java.lang.Object
org.apache.lucene.document.AbstractField
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
Fields inherited from class org.apache.lucene.document.AbstractField |
boost, fieldsData, isBinary, isCompressed, isIndexed, isStored, isTokenized, lazy, name, omitNorms, storeOffsetWithTermVector, storePositionWithTermVector, storeTermVector |
Methods inherited from class org.apache.lucene.document.AbstractField |
getBoost, getOmitNorms, isBinary, isCompressed, isIndexed, isLazy, isStored, isStoreOffsetWithTermVector, isStorePositionWithTermVector, isTermVectorStored, isTokenized, name, setBoost, setOmitNorms, setStoreTermVector, toString |
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.
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-2008 The Apache Software Foundation. All Rights Reserved.