Search in sources :

Example 1 with JoinHandler

use of eu.esdihumboldt.hale.io.appschema.writer.internal.JoinHandler in project hale by halestudio.

the class AppSchemaMappingTest method processJoinAlignment.

private void processJoinAlignment(Alignment alignment, FeatureChaining chainingConf) {
    AppSchemaMappingContext context = new AppSchemaMappingContext(mappingWrapper, alignment, targetTypes, chainingConf, null);
    Cell joinCell = alignment.getTypeCells().iterator().next();
    JoinHandler handler = new JoinHandler();
    handler.handleTypeTransformation(joinCell, context);
    for (Cell propertyCell : alignment.getPropertyCells(joinCell)) {
        String propertyTransformId = propertyCell.getTransformationIdentifier();
        PropertyTransformationHandler propertyTransformHandler;
        try {
            propertyTransformHandler = PropertyTransformationHandlerFactory.getInstance().createPropertyTransformationHandler(propertyTransformId);
            propertyTransformHandler.handlePropertyTransformation(joinCell, propertyCell, context);
        } catch (UnsupportedTransformationException e) {
            Assert.fail("Unsupported transformation was found");
        }
    }
}
Also used : UnsupportedTransformationException(eu.esdihumboldt.hale.io.appschema.writer.internal.UnsupportedTransformationException) AppSchemaMappingContext(eu.esdihumboldt.hale.io.appschema.writer.internal.mapping.AppSchemaMappingContext) PropertyTransformationHandler(eu.esdihumboldt.hale.io.appschema.writer.internal.PropertyTransformationHandler) JoinHandler(eu.esdihumboldt.hale.io.appschema.writer.internal.JoinHandler) DefaultCell(eu.esdihumboldt.hale.common.align.model.impl.DefaultCell) Cell(eu.esdihumboldt.hale.common.align.model.Cell)

Aggregations

Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 DefaultCell (eu.esdihumboldt.hale.common.align.model.impl.DefaultCell)1 JoinHandler (eu.esdihumboldt.hale.io.appschema.writer.internal.JoinHandler)1 PropertyTransformationHandler (eu.esdihumboldt.hale.io.appschema.writer.internal.PropertyTransformationHandler)1 UnsupportedTransformationException (eu.esdihumboldt.hale.io.appschema.writer.internal.UnsupportedTransformationException)1 AppSchemaMappingContext (eu.esdihumboldt.hale.io.appschema.writer.internal.mapping.AppSchemaMappingContext)1