Package de.cxp.ocs.preprocessor.impl
Class RemoveValuesDataProcessor
- java.lang.Object
-
- de.cxp.ocs.preprocessor.ConfigureableDataprocessor<PatternConfiguration>
-
- de.cxp.ocs.preprocessor.impl.RemoveValuesDataProcessor
-
- All Implemented Interfaces:
DocumentPreProcessor
public class RemoveValuesDataProcessor extends ConfigureableDataprocessor<PatternConfiguration>
DocumentPreProcessorimplementation which removes values from a fields value based on a regular expression. Will be auto configured and can be further configuration like described below:data-processor-configuration: processors: - RemoveValuesDataProcessor configuration: RemoveValuesDataProcessor: someFieldName: ".*\\d+.*" someFieldName_destination: "someDestinationField" # Optional configuration: # RegEx used to split the value into chunks, //s+ if omitted someFieldName_wordSplitRegEx: "/" # join character used when combining splitted cleared chunks, default spaceThis would remove all numerical values from the field with the name 'someFieldName' and write it into the field 'someDestinationField'. If no destination is specified, the destination will be the source field. This implementation splits the value into separate tokens and checks the regular expression against each token. If the regular expression matches the token, the token get's removed." "someFieldName_wordJoinSeparator: "/"
-
-
Field Summary
-
Fields inherited from class de.cxp.ocs.preprocessor.ConfigureableDataprocessor
patternConf, properties
-
-
Constructor Summary
Constructors Constructor Description RemoveValuesDataProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PatternConfigurationgetPatternConfiguration(String key, String value, Map<String,String> confMap)Returns theConfigureableFieldholding the parsed configuration for every configured key.protected BiConsumer<PatternConfiguration,Object>getProcessConsumer(Document sourceData, boolean visible)Returns aBiConsumerwhose input is the configuredConfigureableFieldwith the value of the currently processed record.-
Methods inherited from class de.cxp.ocs.preprocessor.ConfigureableDataprocessor
initialize, isRecordVisible, process
-
-
-
-
Method Detail
-
getPatternConfiguration
protected PatternConfiguration getPatternConfiguration(String key, String value, Map<String,String> confMap)
Description copied from class:ConfigureableDataprocessorReturns theConfigureableFieldholding the parsed configuration for every configured key.- Specified by:
getPatternConfigurationin classConfigureableDataprocessor<PatternConfiguration>- 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.
-
getProcessConsumer
protected BiConsumer<PatternConfiguration,Object> getProcessConsumer(Document sourceData, boolean visible)
Description copied from class:ConfigureableDataprocessorReturns 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.- Specified by:
getProcessConsumerin classConfigureableDataprocessor<PatternConfiguration>- Parameters:
sourceData- the record datavisible- the current visibility of the record- Returns:
- a
BiConsumerwhose accept method should handle everyPatternConfigurationwith the corresponding value.
-
-