@API.Public public final class FieldProjector extends BaseFieldProjector
FieldPath
s
and in association with a DocumentReader
, determines which fields form the document reader are
emitted to the applications.
A single instance of ProjectionTree can not be, concurrently, used with multiple DocumentReader
s.
Use cloneWithSharedProjectionTree()
in such cases.currentSegment, includeAllChildren, includeField, lastSegment, level, readerFieldSegment, rootSegment
Constructor and Description |
---|
FieldProjector(Collection<FieldPath> includedPaths) |
FieldProjector(FieldPath... includedPaths) |
FieldProjector(org.ojai.util.impl.ProjectionTree rootSegment) |
FieldProjector(String... includedPaths) |
Modifier and Type | Method and Description |
---|---|
FieldProjector |
cloneWithSharedProjectionTree()
Creates a lightweight clone of this FieldProjector with shared ProjectionTree.
|
void |
moveTo(DocumentReader.EventType event)
This is the main algorithm that determine if the current
DocumentReader
node should be included or excluded based on the set of projected fields. |
FieldProjector |
reset(DocumentReader reader)
Resets the state of this projection tree to the root of the Document.
|
asJsonString, asJsonString, done, isDone, moveTo, reset, shouldEmitEvent, toString
public FieldProjector(@API.NonNullable String... includedPaths)
public FieldProjector(@API.NonNullable FieldPath... includedPaths)
public FieldProjector(@API.NonNullable Collection<FieldPath> includedPaths)
public FieldProjector(org.ojai.util.impl.ProjectionTree rootSegment)
public FieldProjector cloneWithSharedProjectionTree()
cloneWithSharedProjectionTree
in class BaseFieldProjector
public void moveTo(DocumentReader.EventType event)
DocumentReader
node should be included or excluded based on the set of projected fields.moveTo
in class BaseFieldProjector
public FieldProjector reset(DocumentReader reader)
reset
in class BaseFieldProjector
this
for chaining.Copyright © 2015–2018 MapR Technologies, Inc.. All rights reserved.