DocumentStoredFieldVisitor

A StoredFieldVisitor that creates a Document from stored fields.

This visitor supports loading all stored fields, or only specific requested fields provided from a Set.

This is used by StoredFields.document to load a document.

Constructors

Link copied to clipboard
constructor(fieldsToAdd: MutableSet<String>?)

Load only fields named in the provided Set<String>.

constructor(vararg fields: String)

Load only fields named in the provided fields.

constructor()

Load all stored fields.

Properties

Link copied to clipboard

Retrieve the visited document.

Functions

Link copied to clipboard
open override fun binaryField(fieldInfo: FieldInfo, value: ByteArray)

Process a binary field.

open fun binaryField(fieldInfo: FieldInfo, value: StoredFieldDataInput)

Expert: Process a binary field directly from the StoredFieldDataInput. Implementors of this method must read StoredFieldDataInput#length bytes from the given [ ]. The default implementation reads all bytes in a newly created byte array and calls .binaryField.

Link copied to clipboard
open override fun doubleField(fieldInfo: FieldInfo, value: Double)

Process a double numeric field.

Link copied to clipboard
open override fun floatField(fieldInfo: FieldInfo, value: Float)

Process a float numeric field.

Link copied to clipboard
open override fun intField(fieldInfo: FieldInfo, value: Int)

Process an int numeric field.

Link copied to clipboard
open override fun longField(fieldInfo: FieldInfo, value: Long)

Process a long numeric field.

Link copied to clipboard
open override fun needsField(fieldInfo: FieldInfo): StoredFieldVisitor.Status

Hook before processing a field. Before a field is processed, this method is invoked so that subclasses can return a Status representing whether they need that particular field or not, or to stop processing entirely.

Link copied to clipboard
open override fun stringField(fieldInfo: FieldInfo, value: String)

Process a string field.