/** * @since 1.4 */ protected boolean isValidType(JavaType type) { JvmDeclaredType classRef = type.getClassRef(); return classRef != null && !classRef.eIsProxy() && !(classRef instanceof JvmUnknownTypeReference); } }
@Override public Boolean caseJvmDeclaredType(JvmDeclaredType object) { if (!object.eIsProxy()) { level++; for (JvmTypeReference superType : object.getSuperTypes()) { doSwitch(superType); } level--; } return Boolean.FALSE; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmDeclaredType getAggregator() { if (aggregator != null && aggregator.eIsProxy()) { InternalEObject oldAggregator = (InternalEObject)aggregator; aggregator = (JvmDeclaredType)eResolveProxy(oldAggregator); if (aggregator != oldAggregator) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, PatternLanguagePackage.AGGREGATED_VALUE__AGGREGATOR, oldAggregator, aggregator)); } } return aggregator; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmDeclaredType getImportedType() { if (importedType != null && importedType.eIsProxy()) { InternalEObject oldImportedType = (InternalEObject)importedType; importedType = (JvmDeclaredType)eResolveProxy(oldImportedType); if (importedType != oldImportedType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProtelisPackage.IMPORT_DECLARATION__IMPORTED_TYPE, oldImportedType, importedType)); } } return importedType; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmDeclaredType getClassRef() { if (classRef != null && classRef.eIsProxy()) { InternalEObject oldClassRef = (InternalEObject)classRef; classRef = (JvmDeclaredType)eResolveProxy(oldClassRef); if (classRef != oldClassRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, PatternLanguagePackage.JAVA_TYPE__CLASS_REF, oldClassRef, classRef)); } } return classRef; }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public JvmDeclaredType getImportedType() { if (importedType != null && importedType.eIsProxy()) { InternalEObject oldImportedType = (InternalEObject)importedType; importedType = (JvmDeclaredType)eResolveProxy(oldImportedType); if (importedType != oldImportedType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, XtypePackage.XIMPORT_DECLARATION__IMPORTED_TYPE, oldImportedType, importedType)); } } return importedType; }
} else { JvmDeclaredType importedType = importDeclaration.getImportedType(); if (importedType != null && !importedType.eIsProxy()) { if (concreteImports == null || importedNames == null /* to make JDT happy */) { concreteImports = Lists.newArrayListWithCapacity(10);
protected PreferredType findPreferredType(JvmDeclaredType referencedType, String text) { if (referencedType != null && !referencedType.eIsProxy()) { if (referencedType.getDeclaringType() == null) { return new PreferredType(referencedType, referencedType); } String outerSegment = getFirstNameSegment(text); JvmType outerType = findDeclaringTypeBySimpleName(referencedType, outerSegment); if (outerType == null) { throw new IllegalStateException(); } return new PreferredType(outerType, referencedType); } String name = getFirstNameSegment(text); return new PreferredType(name); }
JvmDeclaredType aggregator = expression.getAggregator(); final Class<IAggregatorFactory> clazz = IAggregatorFactory.class; if (aggregator != null && !aggregator.eIsProxy()) { if (typeReferences.is(aggregator, clazz)) { return;
public JvmDeclaredType getSuperTypeNonResolving(AnonymousClass anonymousClass, IScope typeScope) { XConstructorCall constructorCall = anonymousClass.getConstructorCall(); EObject constructorProxy = (EObject) constructorCall.eGet(XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, false); IEObjectDescription description = null; if (constructorProxy != null) { if (!constructorProxy.eIsProxy()) { return getSuperType(anonymousClass); } String fragment = EcoreUtil.getURI(constructorProxy).fragment(); INode node = uriEncoder.getNode(constructorCall, fragment); String name = linkingHelper.getCrossRefNodeAsString(node, true); QualifiedName superTypeName = qualifiedNameConverter.toQualifiedName(name); description = typeScope.getSingleElement(superTypeName); } if (description == null || !EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_DECLARED_TYPE, description.getEClass())) { description = typeScope.getSingleElement(QualifiedName.create("java", "lang", "Object")); } if (description != null && EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_DECLARED_TYPE, description.getEClass())) { JvmDeclaredType type = (JvmDeclaredType) description.getEObjectOrProxy(); if (!type.eIsProxy()) return type; return (JvmDeclaredType) EcoreUtil.resolve(type, anonymousClass); } return null; }