use of io.atlasmap.v2.BaseMapping in project atlasmap by atlasmap.
the class JavaJsonFlatMappingTest method generateJsonJavaFlatMapping.
protected AtlasMapping generateJsonJavaFlatMapping() {
AtlasMapping atlasMapping = AtlasModelFactory.createAtlasMapping();
atlasMapping.setName("JsonJavaFlatMapping");
atlasMapping.getDataSource().add(generateDataSource("atlas:java?className=io.atlasmap.java.test.SourceFlatPrimitiveClass", DataSourceType.SOURCE));
atlasMapping.getDataSource().add(generateDataSource("atlas:json", DataSourceType.TARGET));
List<BaseMapping> mappings = atlasMapping.getMappings().getMapping();
// Add fieldMappings
for (String fieldName : FLAT_FIELDS) {
Mapping mfm = AtlasModelFactory.createMapping(MappingType.MAP);
mfm.getInputField().add(generateJavaField("/" + fieldName));
mfm.getOutputField().add(generateJsonField("/" + fieldName));
mappings.add(mfm);
}
return atlasMapping;
}
Aggregations