boolean _xblockexpression = false; JvmTypeReference _extendedClass = type.getExtendedClass(); JvmType _type = null; if (_extendedClass!=null) {
/** Create a reference to "super" object or to the super type. * * @return the reference. */ public XFeatureCall createReferenceToSuper() { final XExpression expr = getXExpression(); XtendTypeDeclaration type = EcoreUtil2.getContainerOfType(expr, XtendTypeDeclaration.class); JvmType jvmObject = getAssociatedElement(JvmType.class, type, expr.eResource()); final XFeatureCall superFeature = XbaseFactory.eINSTANCE.createXFeatureCall(); JvmIdentifiableElement feature; if (jvmObject instanceof JvmDeclaredType) { feature = ((JvmDeclaredType) jvmObject).getExtendedClass().getType(); } else { feature = findType(expr, getQualifiedName(type)).getType(); if (feature instanceof JvmDeclaredType) { feature = ((JvmDeclaredType) feature).getExtendedClass().getType(); } else { feature = null; } } if (feature == null) { return null; } superFeature.setFeature(feature); return superFeature; }
final Map<ActionParameterTypes, JvmConstructor> superConstructors = CollectionLiterals.newTreeMap((Comparator<ActionParameterTypes>) null); final JvmTypeReference typeRef = jvmElement.getExtendedClass(); final JvmType supertype = (typeRef == null) ? null : typeRef.getType(); if (supertype instanceof JvmGenericType) {
populateInheritanceContext( jvmElement, jvmElement.getExtendedClass(), jvmElement.getExtendedInterfaces(), finalOperations, overridableOperations, inheritedFields,
@Override protected List<IEObjectDescription> getLocalElementsByName(QualifiedName name) { if (THIS.equals(name)) { ITypeReferenceOwner owner = getReceiverType().getOwner(); QualifiedThisOrSuperDescription description = new QualifiedThisOrSuperDescription(name, owner.newParameterizedTypeReference(getTypeLiteral()), getBucket().getId(), true, getReceiver()); return Collections.<IEObjectDescription>singletonList(description); } else if (SUPER.equals(name)) { JvmType receiverRawType = getTypeLiteral(); if (receiverRawType instanceof JvmDeclaredType) { JvmType referencedType = receiverRawType; // If the receiver type is an interface, 'super' always refers to that interface if (!(receiverRawType instanceof JvmGenericType && ((JvmGenericType) receiverRawType).isInterface())) { JvmTypeReference superType = ((JvmDeclaredType) receiverRawType).getExtendedClass(); if (superType != null) { referencedType = superType.getType(); } } ITypeReferenceOwner owner = getReceiverType().getOwner(); QualifiedThisOrSuperDescription description = new QualifiedThisOrSuperDescription(name, owner.newParameterizedTypeReference(referencedType), getBucket().getId(), true, getReceiver()); return Collections.<IEObjectDescription>singletonList(description); } return Collections.emptyList(); } return super.getLocalElementsByName(name); }
private String reassignSuperType(final ITreeAppendable b, final JvmDeclaredType declaredType, final GeneratorConfig config) { String _xblockexpression = null; JvmTypeReference _extendedClass = declaredType.getExtendedClass(); JvmType _type = null; if (_extendedClass!=null) {
@Override protected List<IEObjectDescription> getAllLocalElements() { List<IEObjectDescription> result = super.getAllLocalElements(); if (getSession().isInstanceContext() && !isExplicitStaticFeatureCall()) { ITypeReferenceOwner owner = getReceiverType().getOwner(); QualifiedThisOrSuperDescription thisDescription = new QualifiedThisOrSuperDescription(THIS, owner.newParameterizedTypeReference(getTypeLiteral()), getBucket().getId(), true, getReceiver()); addToList(thisDescription, result); JvmType receiverRawType = getTypeLiteral(); if (receiverRawType instanceof JvmDeclaredType) { JvmType referencedType = receiverRawType; // If the receiver type is an interface, 'super' always refers to that interface if (!(receiverRawType instanceof JvmGenericType && ((JvmGenericType) receiverRawType).isInterface())) { JvmTypeReference superType = ((JvmDeclaredType) receiverRawType).getExtendedClass(); if (superType != null) { referencedType = superType.getType(); } } QualifiedThisOrSuperDescription superDescription = new QualifiedThisOrSuperDescription(SUPER, owner.newParameterizedTypeReference(referencedType), getBucket().getId(), true, getReceiver()); addToList(superDescription, result); } } return result; }