public IndexedJvmTypeAccess getIndexJvmTypeAccess() { if ((this._access == null)) { final Object provider = this.resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().get(URIHelperConstants.PROTOCOL); if ((provider instanceof AbstractJvmTypeProvider)) { this._access = ((AbstractJvmTypeProvider)provider).getIndexedJvmTypeAccess(); } } return this._access; }
private JvmType findTypeByClass(Class<?> clazz) throws UnknownNestedTypeException { IndexedJvmTypeAccess indexedJvmTypeAccess = getIndexedJvmTypeAccess(); URI resourceURI = uriHelper.createResourceURI(clazz); if (indexedJvmTypeAccess != null) { URI proxyURI = resourceURI.appendFragment(uriHelper.getFragment(clazz)); EObject candidate = indexedJvmTypeAccess.getIndexedJvmType(proxyURI, getResourceSet()); if (candidate instanceof JvmType) return (JvmType) candidate; } TypeResource result = (TypeResource) getResourceSet().getResource(resourceURI, true); return findTypeByClass(clazz, result); }
protected void installTypeProvider(final Iterable<String> classPathRoots, final XtextResourceSet resSet, final IndexedJvmTypeAccess typeAccess) { final URLClassLoader classLoader = this.createURLClassLoader(classPathRoots); new ClasspathTypeProvider(classLoader, resSet, typeAccess, null); resSet.setClasspathURIContext(classLoader); }
@Deprecated public CachingReflectionTypeProvider(ClassLoader classLoader, ResourceSet resourceSet, IndexedJvmTypeAccess indexedJvmTypeAccess, ReflectionTypeFactory reusedFactory) { this(classLoader, resourceSet, indexedJvmTypeAccess, reusedFactory, null); }
public CachingReflectionTypeProvider(ClassLoader classLoader, ResourceSet resourceSet, IndexedJvmTypeAccess indexedJvmTypeAccess, ReflectionTypeFactory reusedFactory, TypeResourceServices services) { super(classLoader, resourceSet, indexedJvmTypeAccess, services); this.reusedFactory = reusedFactory; }
@Deprecated public ReflectionTypeProvider(ClassLoader classLoader, ResourceSet resourceSet, IndexedJvmTypeAccess indexedJvmTypeAccess) { this(classLoader, resourceSet, indexedJvmTypeAccess, null); }
public ReflectionTypeProvider(ClassLoader classLoader, ResourceSet resourceSet, IndexedJvmTypeAccess indexedJvmTypeAccess, TypeResourceServices services) { super(resourceSet, indexedJvmTypeAccess, services); classFinder = createClassFinder(classLoader); uriHelper = createClassURIHelper(); reflectionTypeFactory = createDeclaredTypeFactory(); }
public IndexedJvmTypeAccess getIndexedJvmTypeAccess() { return indexedJvmTypeAccess; }
public void setIndexedJvmTypeAccess(IndexedJvmTypeAccess indexedJvmTypeAccess) { this.indexedJvmTypeAccess = indexedJvmTypeAccess; }
protected IndexedJvmTypeAccess getIndexedJvmTypeAccess() { return indexedJvmTypeAccess; }
/** * Creates a new instance of {@link JdtFallbackTypeProviderFactory}. * * @param javaProjectProvider * the {@link IJavaProjectProvider}, may be {@code null} * @param classLoader * the {@link ClassLoader}, must not be {@code null} * @param indexedJvmTypeAccess * the {@link IndexedJvmTypeAccess}, may be {@code null} */ @Inject public JdtFallbackTypeProviderFactory(final IJavaProjectProvider javaProjectProvider, final ClassLoader classLoader, final IndexedJvmTypeAccess indexedJvmTypeAccess, final TypeResourceServices typeResourceServices) { super(javaProjectProvider); this.classLoader = classLoader; this.indexedJvmTypeAccess = indexedJvmTypeAccess; this.typeResourceServices = typeResourceServices; }
/** * Creates a new instance of {@link BundleAwareTypeProvider}. * * @param classLoader * the {@link ClassLoader}, may be {@code null} * @param resourceSet * the {@link ResourceSet}, must not be {@code null} * @param indexedJvmTypeAccess * the {@link IndexedJvmTypeAccess}, may be {@code null} */ public BundleAwareTypeProvider(final ClassLoader classLoader, final ResourceSet resourceSet, final IndexedJvmTypeAccess indexedJvmTypeAccess, final TypeResourceServices typeResourceServices) { super(classLoader, resourceSet, indexedJvmTypeAccess, typeResourceServices); }