use of com.avaloq.tools.ddk.xtext.common.types.access.jdt.BundleAwareTypeProvider in project dsl-devkit by dsldevkit.
the class JdtFallbackTypeProviderFactory method createBundleAwareDelegate.
/**
* Creates a new bundle aware JdtFallbackTypeProvider.
* <p>
* <em>Note</em>: Uses a custom bundle class finder to locate and load classes.
* </p>
*
* @param typeProvider
* the {@link IJdtTypeProvider}, may be {@code null}
* @param resourceSet
* the {@link ResourceSet}, must not be {@code null}
* @return the {@link IJdtTypeProvider}, never {@code null}
*/
protected IJdtTypeProvider createBundleAwareDelegate(final IJdtTypeProvider typeProvider, final ResourceSet resourceSet) {
IJdtTypeProvider firstProvider = typeProvider instanceof NullJdtTypeProvider ? null : typeProvider;
BundleAwareTypeProvider bundleAwareTypeProvider = new BundleAwareTypeProvider(classLoader, resourceSet, indexedJvmTypeAccess, typeResourceServices);
JdtFallbackTypeProvider result = new JdtFallbackTypeProvider(firstProvider, bundleAwareTypeProvider);
resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(URIHelperConstants.PROTOCOL, result);
return result;
}
Aggregations