use of org.eclipse.xtext.resource.IResourceDescription.Manager in project ow by vtst.
the class ResourceDescriptionLoader method getResourceDescription.
public IResourceDescription getResourceDescription(ResourceSet resourceSet, URI uri) {
Resource resource = resourceSet.getResource(uri, true);
if (resource != null) {
IResourceServiceProvider serviceProvider = serviceProviderRegistry.getResourceServiceProvider(uri);
if (serviceProvider == null)
throw new IllegalStateException("No " + IResourceServiceProvider.class.getSimpleName() + " found in registry for uri " + uri);
final Manager resourceDescriptionManager = serviceProvider.getResourceDescriptionManager();
if (resourceDescriptionManager == null)
throw new IllegalStateException("No " + IResourceDescription.Manager.class.getName() + " provided by service provider for URI " + uri);
return resourceDescriptionManager.getResourceDescription(resource);
}
return null;
}
Aggregations