protected StandardTypeReferenceOwner newTypeReferenceOwner(final EObject context) { return new StandardTypeReferenceOwner(this.services, context); } }
protected ITypeReferenceOwner newTypeReferenceOwner(EObject context) { return new StandardTypeReferenceOwner(services, context); }
protected LightweightTypeReferenceFactory getTypeConverter(final XtextResource context) { StandardTypeReferenceOwner _standardTypeReferenceOwner = new StandardTypeReferenceOwner(this.typeComputationServices, context); return new LightweightTypeReferenceFactory(_standardTypeReferenceOwner) { @Override public LightweightTypeReference doVisitParameterizedTypeReference(final JvmParameterizedTypeReference reference) { final LightweightTypeReference result = super.doVisitParameterizedTypeReference(reference); boolean _isFunctionType = result.isFunctionType(); if (_isFunctionType) { return result.tryConvertToFunctionTypeReference(false); } return result; } }; }
public JvmTypeReferenceBuilder create(ResourceSet context) { if (context == null) { throw new NullPointerException("'context' cannot be null."); } JvmTypeReferenceBuilder result = builderProvider.get(); result.context = context; result.typeReferenceOwner = new StandardTypeReferenceOwner(services, context); return result; } }
/** * Static helper method that is used from within the super call in the constructor of * {@link RawResolvedFeatures}. */ private static LightweightTypeReference createTypeReference(JvmDeclaredType type, CommonTypeComputationServices services) { StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, type); return owner.newParameterizedTypeReference(type); }
protected LightweightTypeReference toLightweightTypeReference(final JvmTypeReference typeRef) { return new StandardTypeReferenceOwner(this.services, typeRef).toLightweightTypeReference(typeRef); }
public InvokedResolvedOperation resolve(XAbstractFeatureCall featureCall) { IResolvedTypes resolvedTypes = batchTypeResolver.resolveTypes(featureCall); ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, featureCall); return resolve(featureCall, resolvedTypes, owner); }
@Override public IResolvedTypes resolveTypes(/* @NonNull */ Resource resource, /* @Nullable */ CancelIndicator monitor) { validateResourceState(resource); List<EObject> resourceContents = resource.getContents(); if (resourceContents.isEmpty()) { IFeatureScopeSession session = scopeProvider.newSession(resource); return new EmptyResolvedTypes(session, featureScopes, new StandardTypeReferenceOwner(services, resource)); } else { return resolveTypes(resourceContents.get(0), monitor); } }
public void before(final ActiveAnnotationContexts.AnnotationCallback phase) { this.lastPhase = phase; final StandardTypeReferenceOwner standardTypeReferenceOwner = new StandardTypeReferenceOwner(this.services, this.xtendFile); boolean _equals = Objects.equal(ActiveAnnotationContexts.AnnotationCallback.INDEXING, phase); if (_equals) { IndexingLightweightTypeReferenceFactory _indexingLightweightTypeReferenceFactory = new IndexingLightweightTypeReferenceFactory(standardTypeReferenceOwner); this.typeRefFactory = _indexingLightweightTypeReferenceFactory; } else { LightweightTypeReferenceFactory _lightweightTypeReferenceFactory = new LightweightTypeReferenceFactory(standardTypeReferenceOwner); this.typeRefFactory = _lightweightTypeReferenceFactory; } boolean _equals_1 = Objects.equal(ActiveAnnotationContexts.AnnotationCallback.VALIDATION, phase); if (_equals_1) { this.problemSupport.validationPhaseStarted(); } }
public boolean isAssignableFrom(final JvmTypeReference target, final JvmTypeReference source, final TypeConformanceComputationArgument argument) { if (((target == null) || (source == null))) { throw new RuntimeException("For testing assignment source and target types must not be null"); } if ((this.typeReferenceOwner == null)) { StandardTypeReferenceOwner _standardTypeReferenceOwner = new StandardTypeReferenceOwner(this.services, this.resourceSet); this.typeReferenceOwner = _standardTypeReferenceOwner; } final LightweightTypeReference lleft = this.typeReferenceOwner.toLightweightTypeReference(target); LightweightTypeReference lright = this.typeReferenceOwner.toLightweightTypeReference(source); final boolean assignable = lleft.isAssignableFrom(lright, argument); return assignable; }
protected LightweightTypeReference toLightweightTypeReference(JvmTypeReference typeRef, boolean keepUnboundWildcardInformation) { StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(getServices(), typeRef); LightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory(owner, keepUnboundWildcardInformation); LightweightTypeReference reference = factory.toLightweightReference(typeRef); return reference; }
/** Create a lightweight type reference from the given type. * * @param type the type to point to. * @param context the context in which the reference is located. * @return the reference. */ protected LightweightTypeReference toLightweightTypeReference(JvmType type, EObject context) { final StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(getServices(), context); final LightweightTypeReferenceFactory factory = new LightweightTypeReferenceFactory(owner, false); return factory.toLightweightReference(type); }
/** * Returns the resolved features targeting a specific Java version in order to support new language features. */ public ResolvedFeatures getResolvedFeatures(JvmTypeReference contextType, JavaVersion targetVersion) { ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, contextType.eResource().getResourceSet()); return getResolvedFeatures(owner.toLightweightTypeReference(contextType), targetVersion); }
/** * Returns the resolved features that are defined in the given <code>type</code> and its supertypes. * Considers private methods of super types, too. * @param type the type. Has to be contained in a resource. * @return the resolved features. */ public ResolvedFeatures getResolvedFeatures(JvmDeclaredType type) { ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, type.eResource().getResourceSet()); LightweightTypeReference contextType = owner.toLightweightTypeReference(type); return getResolvedFeatures(contextType); }
/** * Returns the resolved features targeting a specific Java version in order to support new language features. */ public ResolvedFeatures getResolvedFeatures(JvmDeclaredType type, JavaVersion targetVersion) { ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, type.eResource().getResourceSet()); LightweightTypeReference contextType = owner.toLightweightTypeReference(type); return getResolvedFeatures(contextType, targetVersion); }
public JvmTypeReference resolveMultiType(JvmTypeReference reference, EObject context) { ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, context.eResource().getResourceSet()); return owner.toLightweightTypeReference(reference).toJavaCompliantTypeReference(); } }
/** * Returns the resolved features that are defined in the given <code>context type</code> and its supertypes. * Considers private methods of super types, too. * @param contextType the context type. Has to be contained in a resource. * @return the resolved features. */ public ResolvedFeatures getResolvedFeatures(JvmTypeReference contextType) { ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, contextType.eResource().getResourceSet()); return getResolvedFeatures(owner.toLightweightTypeReference(contextType)); }
/** * Return all the cases that are associated with the given dispatch operation. */ public List<JvmOperation> getAllDispatchCases(JvmOperation dispatcherOperation) { DispatchSignature dispatchSignature = new DispatchSignature(dispatcherOperation.getSimpleName(), dispatcherOperation.getParameters().size()); JvmDeclaredType type = dispatcherOperation.getDeclaringType(); ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, type); ContextualVisibilityHelper contextualVisibilityHelper = new ContextualVisibilityHelper(visibilityHelper, owner.newParameterizedTypeReference(type)); return getAllDispatchMethods(dispatchSignature, type, contextualVisibilityHelper); }
public void setXtendFile(final XtendFile xtendFile) { this.xtendFile = xtendFile; StandardTypeReferenceOwner _standardTypeReferenceOwner = new StandardTypeReferenceOwner(this.services, xtendFile); LightweightTypeReferenceFactory _lightweightTypeReferenceFactory = new LightweightTypeReferenceFactory(_standardTypeReferenceOwner); this.typeRefFactory = _lightweightTypeReferenceFactory; this.fileSystemSupport.setContext(xtendFile.eResource().getResourceSet()); this.fileLocations.setContext(xtendFile.eResource()); }
public JvmOperation findOverriddenOperation(JvmOperation operation) { if (operation.getVisibility() == JvmVisibility.PRIVATE) { return null; } ITypeReferenceOwner owner = new StandardTypeReferenceOwner(services, operation.eResource().getResourceSet()); LightweightTypeReference declaringType = owner.toLightweightTypeReference(operation.getDeclaringType()); TypeParameterSubstitutor<?> substitutor = createSubstitutor(owner, declaringType); return findOverriddenOperation(operation, declaringType, substitutor, owner, new ContextualVisibilityHelper(visibilityHelper, declaringType)); }