@Beta
public interface CdsDataProcessor
CdsDataProcessor.Generator
,
CdsDataProcessor.Converter
or CdsDataProcessor.Validator
.Modifier and Type | Interface and Description |
---|---|
static interface |
CdsDataProcessor.Converter
Function to convert or remove a value for a CdsElement.
|
static interface |
CdsDataProcessor.Filter
Predicate to filter a CdsElement by the element's CdsType.
|
static interface |
CdsDataProcessor.Generator
Function to compute a value for a CdsElement.
|
static class |
CdsDataProcessor.Mode
The processing mode:
CdsDataProcessor.Mode.DECLARED , CdsDataProcessor.Mode.CONTAINS , CdsDataProcessor.Mode.NOT_NULL
or CdsDataProcessor.Mode.NULL . |
static interface |
CdsDataProcessor.Validator
Function to validate the value of a CdsElement.
|
Modifier and Type | Field and Description |
---|---|
static Object |
ABSENT
Indicates the absence of a value in the data map.
|
Modifier and Type | Method and Description |
---|---|
CdsDataProcessor |
addConverter(CdsDataProcessor.Filter filter,
CdsDataProcessor.Converter valConverter)
Adds a function to convert values of elements that match a given filter.
|
CdsDataProcessor |
addGenerator(CdsDataProcessor.Filter filter,
CdsDataProcessor.Generator valGenerator)
Adds a function to generate values for elements that match a given filter and
are missing in the data or mapped to null.
|
default CdsDataProcessor |
addValidator(CdsDataProcessor.Filter filter,
CdsDataProcessor.Validator validator)
Adds a function to validate values of elements that match a given filter.
|
CdsDataProcessor |
addValidator(CdsDataProcessor.Filter filter,
CdsDataProcessor.Validator validator,
CdsDataProcessor.Mode mode)
Adds a function to validate values of elements that match a given filter.
|
static CdsDataProcessor |
create()
Creates a new DataProcessor instance.
|
void |
process(Iterable<? extends Map<String,Object>> entries,
CdsStructuredType entryType)
Runs the CdsDataProcessor on the given data entries.
|
void |
process(Map<String,Object> entry,
CdsStructuredType entryType)
Runs the CdsDataProcessor on the given data entry.
|
default void |
process(Result result)
Runs the CdsDataProcessor on the given CDS.ql result.
|
static final Object ABSENT
static CdsDataProcessor create()
CdsDataProcessor addConverter(CdsDataProcessor.Filter filter, CdsDataProcessor.Converter valConverter)
filter
- the filter predicate, see CdsDataProcessor.Filter
valConverter
- the value converter function, see CdsDataProcessor.Converter
CdsDataProcessor addGenerator(CdsDataProcessor.Filter filter, CdsDataProcessor.Generator valGenerator)
filter
- the filter predicate, see CdsDataProcessor.Filter
valGenerator
- the Value CdsDataProcessor.Generator
functiondefault CdsDataProcessor addValidator(CdsDataProcessor.Filter filter, CdsDataProcessor.Validator validator)
addValidator(Filter, Validator, Mode)
filter
- the filter predicate, see CdsDataProcessor.Filter
validator
- the validation function, see CdsDataProcessor.Validator
CdsDataProcessor addValidator(CdsDataProcessor.Filter filter, CdsDataProcessor.Validator validator, CdsDataProcessor.Mode mode)
filter
- the filter predicate, see CdsDataProcessor.Filter
validator
- the validation function, see CdsDataProcessor.Validator
mode
- the processing CdsDataProcessor.Mode
void process(Map<String,Object> entry, CdsStructuredType entryType)
entry
- the data entryentryType
- the CDS type of the data entryvoid process(Iterable<? extends Map<String,Object>> entries, CdsStructuredType entryType)
entries
- the data entriesentryType
- the CDS type of the data entriesdefault void process(Result result)
result
- the CDS.ql resultCopyright © 2021 SAP. All rights reserved.