Search in sources :

Example 1 with ConverterContext

use of com.opensimulationplatform.systemstructure.xml.converter.ConverterContext in project osp-validator by open-simulation-platform.

the class SystemStructureFactory method create.

public SystemStructure create(File ospSystemStructureFile) {
    OspSystemStructureParser parser = new OspSystemStructureParser();
    OspSystemStructure ospSystemStructure = parser.parse(ospSystemStructureFile);
    if (fmuLocator == null) {
        fmuLocator = new DefaultFmuLocator(ospSystemStructureFile);
    }
    if (ospModelDescriptionLocator == null) {
        ospModelDescriptionLocator = new DefaultOspModelDescriptionLocator(ospSystemStructureFile, fmuLocator);
    }
    ConverterContext context = new ConverterContext();
    context.ospModelDescriptionLocator = ospModelDescriptionLocator;
    context.fmuLocator = fmuLocator;
    OspSystemStructureConverter converter = new OspSystemStructureConverter(context);
    return converter.convert(ospSystemStructure);
}
Also used : OspSystemStructureParser(com.opensimulationplatform.systemstructure.xml.parser.OspSystemStructureParser) ConverterContext(com.opensimulationplatform.systemstructure.xml.converter.ConverterContext) DefaultFmuLocator(com.opensimulationplatform.systemstructure.util.DefaultFmuLocator) OspSystemStructureConverter(com.opensimulationplatform.systemstructure.xml.converter.OspSystemStructureConverter) OspSystemStructure(com.opensimulationplatform.systemstructure.xml.model.OspSystemStructure) DefaultOspModelDescriptionLocator(com.opensimulationplatform.systemstructure.util.DefaultOspModelDescriptionLocator)

Aggregations

DefaultFmuLocator (com.opensimulationplatform.systemstructure.util.DefaultFmuLocator)1 DefaultOspModelDescriptionLocator (com.opensimulationplatform.systemstructure.util.DefaultOspModelDescriptionLocator)1 ConverterContext (com.opensimulationplatform.systemstructure.xml.converter.ConverterContext)1 OspSystemStructureConverter (com.opensimulationplatform.systemstructure.xml.converter.OspSystemStructureConverter)1 OspSystemStructure (com.opensimulationplatform.systemstructure.xml.model.OspSystemStructure)1 OspSystemStructureParser (com.opensimulationplatform.systemstructure.xml.parser.OspSystemStructureParser)1