use of org.eclipse.vorto.core.ui.parser.IModelParser in project vorto by eclipse.
the class ModelParserFactory method getModelParser.
public IModelParser getModelParser() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(IModelParser.EXTENSIONPOINT_ID);
IExtension[] modelParserExtensions = extensionPoint.getExtensions();
if (modelParserExtensions.length == 0) {
throw new RuntimeException("No Vorto Model Parser found!");
} else if (modelParserExtensions.length > 1) {
throw new RuntimeException("More than 1 Vorto Model Parser found. Cannot decide which one to bind. ");
}
try {
return (IModelParser) modelParserExtensions[0].getConfigurationElements()[0].createExecutableExtension("class");
} catch (Exception e) {
throw new RuntimeException("Problem binding Vorto Model Parser", e);
}
}
Aggregations