Package org.apache.lucene.index
Class StoredFieldVisitor
- java.lang.Object
-
- org.apache.lucene.index.StoredFieldVisitor
-
- Direct Known Subclasses:
DocumentStoredFieldVisitor,PathStoredFieldVisitor
public abstract class StoredFieldVisitor extends java.lang.ObjectExpert: provides a low-level means of accessing the stored field values in an index. SeeIndexReader.document(int, StoredFieldVisitor).NOTE: a
StoredFieldVisitorimplementation should not try to load or visit other stored documents in the same reader because the implementation of stored fields for most codecs is not reeentrant and you will see strange exceptions as a result.See
DocumentStoredFieldVisitor, which is aStoredFieldVisitorthat builds theDocumentcontaining all stored fields. This is used byIndexReader.document(int).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStoredFieldVisitor.StatusEnumeration of possible return values forneedsField(org.apache.lucene.index.FieldInfo).
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbinaryField(FieldInfo fieldInfo, byte[] value)Process a binary field.voiddoubleField(FieldInfo fieldInfo, double value)Process a double numeric field.voidfloatField(FieldInfo fieldInfo, float value)Process a float numeric field.voidintField(FieldInfo fieldInfo, int value)Process a int numeric field.voidlongField(FieldInfo fieldInfo, long value)Process a long numeric field.abstract StoredFieldVisitor.StatusneedsField(FieldInfo fieldInfo)Hook before processing a field.voidstringField(FieldInfo fieldInfo, java.lang.String value)Process a string field
-
-
-
Method Detail
-
binaryField
public void binaryField(FieldInfo fieldInfo, byte[] value) throws java.io.IOException
Process a binary field.- Parameters:
value- newly allocated byte array with the binary contents.- Throws:
java.io.IOException
-
stringField
public void stringField(FieldInfo fieldInfo, java.lang.String value) throws java.io.IOException
Process a string field- Throws:
java.io.IOException
-
intField
public void intField(FieldInfo fieldInfo, int value) throws java.io.IOException
Process a int numeric field.- Throws:
java.io.IOException
-
longField
public void longField(FieldInfo fieldInfo, long value) throws java.io.IOException
Process a long numeric field.- Throws:
java.io.IOException
-
floatField
public void floatField(FieldInfo fieldInfo, float value) throws java.io.IOException
Process a float numeric field.- Throws:
java.io.IOException
-
doubleField
public void doubleField(FieldInfo fieldInfo, double value) throws java.io.IOException
Process a double numeric field.- Throws:
java.io.IOException
-
needsField
public abstract StoredFieldVisitor.Status needsField(FieldInfo fieldInfo) throws java.io.IOException
Hook before processing a field. Before a field is processed, this method is invoked so that subclasses can return aStoredFieldVisitor.Statusrepresenting whether they need that particular field or not, or to stop processing entirely.- Throws:
java.io.IOException
-
-