org.eclipse.xtext.xbase.impl.XFeatureCallImpl Maven / Gradle / Ivy
/**
* Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.eclipse.xtext.xbase.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.xtext.common.types.JvmDeclaredType;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.XFeatureCall;
import org.eclipse.xtext.xbase.XbasePackage;
/**
*
* An implementation of the model object 'XFeature Call'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.xbase.impl.XFeatureCallImpl#getFeatureCallArguments Feature Call Arguments}
* - {@link org.eclipse.xtext.xbase.impl.XFeatureCallImpl#isExplicitOperationCall Explicit Operation Call}
* - {@link org.eclipse.xtext.xbase.impl.XFeatureCallImpl#getDeclaringType Declaring Type}
*
*
*
* @generated
*/
public class XFeatureCallImpl extends XAbstractFeatureCallImplCustom implements XFeatureCall
{
/**
* The cached value of the '{@link #getFeatureCallArguments() Feature Call Arguments}' containment reference list.
*
*
* @see #getFeatureCallArguments()
* @generated
* @ordered
*/
protected EList featureCallArguments;
/**
* The default value of the '{@link #isExplicitOperationCall() Explicit Operation Call}' attribute.
*
*
* @see #isExplicitOperationCall()
* @generated
* @ordered
*/
protected static final boolean EXPLICIT_OPERATION_CALL_EDEFAULT = false;
/**
* The cached value of the '{@link #isExplicitOperationCall() Explicit Operation Call}' attribute.
*
*
* @see #isExplicitOperationCall()
* @generated
* @ordered
*/
protected boolean explicitOperationCall = EXPLICIT_OPERATION_CALL_EDEFAULT;
/**
* The cached value of the '{@link #getDeclaringType() Declaring Type}' reference.
*
*
* @see #getDeclaringType()
* @generated
* @ordered
*/
protected JvmDeclaredType declaringType;
/**
*
*
* @generated
*/
protected XFeatureCallImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return XbasePackage.Literals.XFEATURE_CALL;
}
/**
*
*
* @generated
*/
public EList getFeatureCallArguments()
{
if (featureCallArguments == null)
{
featureCallArguments = new EObjectContainmentEList(XExpression.class, this, XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS);
}
return featureCallArguments;
}
/**
*
*
* @generated
*/
public boolean isExplicitOperationCall()
{
return explicitOperationCall;
}
/**
*
*
* @generated
*/
public void setExplicitOperationCall(boolean newExplicitOperationCall)
{
boolean oldExplicitOperationCall = explicitOperationCall;
explicitOperationCall = newExplicitOperationCall;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL, oldExplicitOperationCall, explicitOperationCall));
}
/**
*
*
* @generated
*/
public JvmDeclaredType getDeclaringType()
{
if (declaringType != null && declaringType.eIsProxy())
{
InternalEObject oldDeclaringType = (InternalEObject)declaringType;
declaringType = (JvmDeclaredType)eResolveProxy(oldDeclaringType);
if (declaringType != oldDeclaringType)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, XbasePackage.XFEATURE_CALL__DECLARING_TYPE, oldDeclaringType, declaringType));
}
}
return declaringType;
}
/**
*
*
* @generated
*/
public JvmDeclaredType basicGetDeclaringType()
{
return declaringType;
}
/**
*
*
* @generated
*/
public void setDeclaringType(JvmDeclaredType newDeclaringType)
{
JvmDeclaredType oldDeclaringType = declaringType;
declaringType = newDeclaringType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XFEATURE_CALL__DECLARING_TYPE, oldDeclaringType, declaringType));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS:
return ((InternalEList>)getFeatureCallArguments()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS:
return getFeatureCallArguments();
case XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL:
return isExplicitOperationCall();
case XbasePackage.XFEATURE_CALL__DECLARING_TYPE:
if (resolve) return getDeclaringType();
return basicGetDeclaringType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS:
getFeatureCallArguments().clear();
getFeatureCallArguments().addAll((Collection extends XExpression>)newValue);
return;
case XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL:
setExplicitOperationCall((Boolean)newValue);
return;
case XbasePackage.XFEATURE_CALL__DECLARING_TYPE:
setDeclaringType((JvmDeclaredType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS:
getFeatureCallArguments().clear();
return;
case XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL:
setExplicitOperationCall(EXPLICIT_OPERATION_CALL_EDEFAULT);
return;
case XbasePackage.XFEATURE_CALL__DECLARING_TYPE:
setDeclaringType((JvmDeclaredType)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS:
return featureCallArguments != null && !featureCallArguments.isEmpty();
case XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL:
return explicitOperationCall != EXPLICIT_OPERATION_CALL_EDEFAULT;
case XbasePackage.XFEATURE_CALL__DECLARING_TYPE:
return declaringType != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (explicitOperationCall: ");
result.append(explicitOperationCall);
result.append(')');
return result.toString();
}
} //XFeatureCallImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy