@Override protected List<IEObjectDescription> getAllLocalElements() { List<IEObjectDescription> result = Lists.newArrayList(); addToList(getLocalElementsByName(THIS), result); addToList(getLocalElementsByName(SUPER), result); return result; }
protected List<IEObjectDescription> createConstructorDescriptions(QualifiedName name, JvmGenericType type, boolean superType) { Iterable<JvmConstructor> constructors = type.getDeclaredConstructors(); List<IEObjectDescription> result = Lists.newArrayListWithCapacity(3); for(JvmConstructor constructor: constructors) { addToList(createDescription(name, constructor, superType), result); } return result; }
protected IEObjectDescription createDescription(QualifiedName name, JvmConstructor constructor, boolean superType) { if (superType) return new SuperConstructorDescription(name, constructor, getReceiverTypeParameterMapping(), 0, getSession().isVisible(constructor)); return new ConstructorDescription(name, constructor, 0, getSession().isVisible(constructor)); }
@Override protected List<IEObjectDescription> getLocalElementsByName(QualifiedName name) { if (THIS.equals(name) || SUPER.equals(name)) { IEObjectDescription description = getSession().getLocalElement(name); if (description != null) { EObject objectOrProxy = description.getEObjectOrProxy(); if (objectOrProxy instanceof JvmGenericType && !objectOrProxy.eIsProxy()) { return createConstructorDescriptions(name, (JvmGenericType) objectOrProxy, SUPER.equals(name)); } } } return Collections.emptyList(); }
/** * A constructor delegate scope provides the descriptions for {@code this()} and {@code super()} * calls in a constructor body. */ protected IScope createConstructorDelegateScope(EObject featureCall, LightweightTypeReference type, IScope parent, IFeatureScopeSession session) { return new ConstructorDelegateScope(parent, type, session, asAbstractFeatureCall(featureCall)); }