use of io.atlasmap.v2.DataSourceType in project syndesis-qe by syndesisio.
the class AtlasMapperGenerator method createDataSource.
/**
* Used to generate data source elements for atlasMapping. There are three types of them: Java, Json, XML.
*
* TODO(tplevko): update also for XML
*
* @param dataShape
* @param step
* @param dataSourceType
* @return
*/
private DataSource createDataSource(DataShape dataShape, StepDefinition step, DataSourceType dataSourceType) {
DataShapeKinds dataShapeKind = dataShape.getKind();
DataSource source = null;
if (dataShapeKind.toString().contains("json")) {
source = new JsonDataSource();
source.setUri("atlas:" + "json:" + step.getStep().getId().get());
} else if (dataShapeKind.toString().contains("java")) {
source = new DataSource();
source.setUri("atlas:" + "java:" + step.getStep().getId().get() + "?className=" + dataShape.getType());
} else if (dataShapeKind.toString().contains("xml")) {
source = new XmlDataSource();
// TODO(tplevko): find out how should look the XML datasource definition
}
source.setId(step.getStep().getId().get());
source.setDataSourceType(dataSourceType);
return source;
}
use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.
the class XmlValidationServiceTest method generateDataSource.
protected DataSource generateDataSource(String uri, DataSourceType type) {
DataSource ds = new DataSource();
ds.setUri(uri);
ds.setDataSourceType(type);
return ds;
}
use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.
the class JsonValidationServiceTest method generateDataSource.
protected DataSource generateDataSource(String uri, DataSourceType type) {
DataSource ds = new DataSource();
ds.setUri(uri);
ds.setDataSourceType(type);
return ds;
}
use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.
the class JsonJsonFlatMappingTest method generateDataSource.
protected DataSource generateDataSource(String uri, DataSourceType type) {
DataSource ds = new DataSource();
ds.setUri(uri);
ds.setDataSourceType(type);
return ds;
}
use of io.atlasmap.v2.DataSourceType in project atlasmap by atlasmap.
the class JavaJavaDateTimeMappingTest method addDataSource.
private void addDataSource(AtlasMapping mapping, String uri, DataSourceType type) {
DataSource ds = new DataSource();
ds.setUri(uri);
ds.setDataSourceType(type);
mapping.getDataSource().add(ds);
}
Aggregations