Search in sources :

Example 1 with InfomodelData

use of org.eclipse.vorto.service.mapping.normalized.InfomodelData in project vorto by eclipse.

the class AbstractDataMapper method map.

public MappedData map(DataInput input, MappingContext mappingContext) {
    JXPathContext context = newContext(input.getValue());
    context.setFunctions(converterLibrary);
    InfomodelData normalized = new InfomodelData();
    final Infomodel deviceInfoModel = specification.getInfoModel();
    for (ModelProperty fbProperty : deviceInfoModel.getFunctionblocks()) {
        if (mappingContext.isIncluded(fbProperty.getName())) {
            FunctionblockData mappedFb = mapFunctionBlock(fbProperty, context);
            if (mappedFb != null) {
                normalized.withFunctionblock(mappedFb);
            }
        }
    }
    return this.doMap(normalized, mappingContext);
}
Also used : JXPathContext(org.apache.commons.jxpath.JXPathContext) Infomodel(org.eclipse.vorto.repository.api.content.Infomodel) ModelProperty(org.eclipse.vorto.repository.api.content.ModelProperty) FunctionblockData(org.eclipse.vorto.service.mapping.normalized.FunctionblockData) InfomodelData(org.eclipse.vorto.service.mapping.normalized.InfomodelData)

Aggregations

JXPathContext (org.apache.commons.jxpath.JXPathContext)1 Infomodel (org.eclipse.vorto.repository.api.content.Infomodel)1 ModelProperty (org.eclipse.vorto.repository.api.content.ModelProperty)1 FunctionblockData (org.eclipse.vorto.service.mapping.normalized.FunctionblockData)1 InfomodelData (org.eclipse.vorto.service.mapping.normalized.InfomodelData)1