Interface EdmxFlavourMapper
- All Known Implementing Classes:
NoopEdmxFlavourMapper
,V4EdmxFlavourMapper
public interface EdmxFlavourMapper
Maps data which is in an EDMX-defined structure to CSN-defined structure and vice versa.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Describes the EDMX flavour used together with Universal CSN.static interface
TheCdsElement
with it's name in the EDMX and CSN. -
Method Summary
Modifier and TypeMethodDescriptionstatic EdmxFlavourMapper
create
(EdmxFlavourMapper.EdmxFlavour flavour, boolean toCsn) Stream<? extends EdmxFlavourMapper.Mapping>
createMappings
(com.sap.cds.reflect.CdsStructuredType type) A stream ofEdmxFlavourMapper.Mapping
instances for each element of aCdsStructuredType
.Remaps a simple element name of a given structured typeremap
(T entry, com.sap.cds.reflect.CdsStructuredType entryType) Remaps a data map of a given structured typeremap
(T entries, com.sap.cds.reflect.CdsStructuredType entryType, Function<String, Boolean> isExpanded) Remaps an Iterable of data maps of a given structured type
-
Method Details
-
create
-
remap
Remaps a simple element name of a given structured type- Parameters:
element
- the element nametype
- the structured type- Returns:
- the mapped element name
-
remap
default <T extends Map<String,Object>> T remap(T entry, com.sap.cds.reflect.CdsStructuredType entryType) Remaps a data map of a given structured type- Type Parameters:
T
- the map type- Parameters:
entry
- the data mapentryType
- the structured type of the entry- Returns:
- the mapped data map
-
remap
default <T extends Iterable<? extends Map<String,Object>>> T remap(T entries, com.sap.cds.reflect.CdsStructuredType entryType) Remaps an Iterable of data maps of a given structured type- Type Parameters:
T
- the Iterable type- Parameters:
entries
- an Iterable of data mapsentryType
- the structured type of the entries- Returns:
- the mapped Iterable of data maps
-
remap
<T extends Iterable<? extends Map<String,Object>>> T remap(T entries, com.sap.cds.reflect.CdsStructuredType entryType, Function<String, Boolean> isExpanded) Remaps an Iterable of data maps of a given structured type- Type Parameters:
T
- the Iterable type- Parameters:
entries
- an Iterable of data mapsentryType
- the structured type of the entriesisExpanded
- a function to determine if the given path is expanded- Returns:
- the mapped Iterable of data maps
-
createMappings
Stream<? extends EdmxFlavourMapper.Mapping> createMappings(com.sap.cds.reflect.CdsStructuredType type) A stream ofEdmxFlavourMapper.Mapping
instances for each element of aCdsStructuredType
.- Parameters:
type
- theCdsStructuredType
- Returns:
- the stream of all
EdmxFlavourMapper.Mapping
instances
-