Package de.cxp.ocs.preprocessor
Class ConfigureableDataprocessor<T extends ConfigureableField>
java.lang.Object
de.cxp.ocs.preprocessor.ConfigureableDataprocessor<T>
- Type Parameters:
T-ConfigureableFieldimplementation to which theDocumentPreProcessorgets mapped.
- All Implemented Interfaces:
DocumentPreProcessor
- Direct Known Subclasses:
RemoveValuesDataProcessor,ReplacePatternInValuesDataProcessor,SplitValueDataProcessor
public abstract class ConfigureableDataprocessor<T extends ConfigureableField>
extends Object
implements DocumentPreProcessor
Abstract class which handles reading and initializing
DocumentPreProcessor
implementations which need further configuration.- Author:
- hjk
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TReturns theConfigureableFieldholding the parsed configuration for every configured key.protected abstract BiConsumer<T, Object> getProcessConsumer(Document sourceDocument, boolean visible) Returns aBiConsumerwhose input is the configuredConfigureableFieldwith the value of the currently processed record.voidinitialize(FieldConfigAccess fieldConfig, Map<String, String> confMap) DataPreProcessor MUST have a no-args constructor.protected booleanisRecordVisible(Document sourceDocument, boolean visible) Called at the end of each process(Document, boolean) run aftergetProcessConsumer(Document, boolean)is has run for everyConfigureableField, to determine weather the record should be visible or not.booleanCalled for each source document.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.cxp.ocs.spi.indexer.DocumentPreProcessor
finish
-
Field Details
-
properties
-
patternConf
-
-
Constructor Details
-
ConfigureableDataprocessor
public ConfigureableDataprocessor()
-
-
Method Details
-
initialize
Description copied from interface:DocumentPreProcessorDataPreProcessor MUST have a no-args constructor. To configure it afterwards, this method will be used.- Specified by:
initializein interfaceDocumentPreProcessor- Parameters:
fieldConfig- field config accessconfMap- custom string-to-string map that can be configured per DocumentPreProcessor.
-
getPatternConfiguration
Returns theConfigureableFieldholding the parsed configuration for every configured key.- Parameters:
key- a key from the data processor configuration for this data processor.value- the value of that key.confMap- the complete data processor configuration map.- Returns:
- the parsed configurable field for the key.
-
process
Description copied from interface:DocumentPreProcessorCalled for each source document.- Specified by:
processin interfaceDocumentPreProcessor- Parameters:
sourceDocument- source documentvisible- weather or not the record is currently marked for indexing.- Returns:
trueif the record should be indexed,falseotherwise.
-
getProcessConsumer
protected abstract BiConsumer<T,Object> getProcessConsumer(Document sourceDocument, boolean visible) Returns aBiConsumerwhose input is the configuredConfigureableFieldwith the value of the currently processed record. The consumer gets called in theDocumentPreProcessor.process(Document, boolean)method for each configured key.- Parameters:
sourceDocument- the record datavisible- the current visibility of the record- Returns:
- a
BiConsumerwhose accept method should handle everyPatternConfigurationwith the corresponding value.
-
isRecordVisible
Called at the end of each process(Document, boolean) run aftergetProcessConsumer(Document, boolean)is has run for everyConfigureableField, to determine weather the record should be visible or not.- Parameters:
sourceDocument- the record datavisible- the current visibility of the record- Returns:
trueif the record should be indexed,falseotherwise.
-