use of eu.esdihumboldt.hale.io.appschema.writer.internal.TypeTransformationHandler in project hale by halestudio.
the class AppSchemaMappingGenerator method createTypeMappings.
private void createTypeMappings(AppSchemaMappingContext context, IOReporter reporter) {
Collection<? extends Cell> typeCells = alignment.getTypeCells();
for (Cell typeCell : typeCells) {
String typeTransformId = typeCell.getTransformationIdentifier();
TypeTransformationHandler typeTransformHandler = null;
try {
typeTransformHandler = TypeTransformationHandlerFactory.getInstance().createTypeTransformationHandler(typeTransformId);
FeatureTypeMapping ftMapping = typeTransformHandler.handleTypeTransformation(typeCell, context);
if (ftMapping != null) {
Collection<? extends Cell> propertyCells = alignment.getPropertyCells(typeCell);
for (Cell propertyCell : propertyCells) {
String propertyTransformId = propertyCell.getTransformationIdentifier();
PropertyTransformationHandler propertyTransformHandler = null;
try {
propertyTransformHandler = PropertyTransformationHandlerFactory.getInstance().createPropertyTransformationHandler(propertyTransformId);
propertyTransformHandler.handlePropertyTransformation(typeCell, propertyCell, context);
} catch (UnsupportedTransformationException e) {
String errMsg = MessageFormat.format("Error processing property cell {0}", propertyCell.getId());
log.warn(errMsg, e);
if (reporter != null) {
reporter.warn(new IOMessageImpl(errMsg, e));
}
}
}
}
} catch (UnsupportedTransformationException e) {
String errMsg = MessageFormat.format("Error processing type cell{0}", typeCell.getId());
log.warn(errMsg, e);
if (reporter != null) {
reporter.warn(new IOMessageImpl(errMsg, e));
}
}
}
}
Aggregations