use of com.opensimulationplatform.systemstructure.xml.parser.OspSystemStructureParser in project osp-validator by open-simulation-platform.
the class Validator method validate.
public List<String> validate(File ospSystemStructureFile) {
List<String> errorMessages = new ArrayList<>();
OspSystemStructureParser parser = new OspSystemStructureParser();
OspSystemStructure ospSystemStructureElement = parser.parse(ospSystemStructureFile);
Map<Object, Location> locations = parser.getLocations();
errorMessages.addAll(getModelDescriptionErrorMessages(ospSystemStructureFile, ospSystemStructureElement));
errorMessages.addAll(getSystemStructureErrorMessages(ospSystemStructureFile, ospSystemStructureElement, locations));
return errorMessages;
}
use of com.opensimulationplatform.systemstructure.xml.parser.OspSystemStructureParser 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);
}
Aggregations