All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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.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#isTypeLiteral Type Literal}
  • *
  • {@link org.eclipse.xtext.xbase.impl.XFeatureCallImpl#isPackageFragment Package Fragment}
  • *
* * @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 default value of the '{@link #isTypeLiteral() Type Literal}' attribute. * * * @see #isTypeLiteral() * @generated * @ordered */ protected static final boolean TYPE_LITERAL_EDEFAULT = false; /** * The cached value of the '{@link #isTypeLiteral() Type Literal}' attribute. * * * @see #isTypeLiteral() * @generated * @ordered */ protected boolean typeLiteral = TYPE_LITERAL_EDEFAULT; /** * The default value of the '{@link #isPackageFragment() Package Fragment}' attribute. * * * @see #isPackageFragment() * @generated * @ordered */ protected static final boolean PACKAGE_FRAGMENT_EDEFAULT = false; /** * The cached value of the '{@link #isPackageFragment() Package Fragment}' attribute. * * * @see #isPackageFragment() * @generated * @ordered */ protected boolean packageFragment = PACKAGE_FRAGMENT_EDEFAULT; /** * * * @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 boolean isTypeLiteral() { return typeLiteral; } /** * * * @generated */ public void setTypeLiteral(boolean newTypeLiteral) { boolean oldTypeLiteral = typeLiteral; typeLiteral = newTypeLiteral; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XFEATURE_CALL__TYPE_LITERAL, oldTypeLiteral, typeLiteral)); } /** * * * @generated */ public boolean isPackageFragment() { return packageFragment; } /** * * * @generated */ public void setPackageFragment(boolean newPackageFragment) { boolean oldPackageFragment = packageFragment; packageFragment = newPackageFragment; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XFEATURE_CALL__PACKAGE_FRAGMENT, oldPackageFragment, packageFragment)); } /** * * * @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__TYPE_LITERAL: return isTypeLiteral(); case XbasePackage.XFEATURE_CALL__PACKAGE_FRAGMENT: return isPackageFragment(); } 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)newValue); return; case XbasePackage.XFEATURE_CALL__EXPLICIT_OPERATION_CALL: setExplicitOperationCall((Boolean)newValue); return; case XbasePackage.XFEATURE_CALL__TYPE_LITERAL: setTypeLiteral((Boolean)newValue); return; case XbasePackage.XFEATURE_CALL__PACKAGE_FRAGMENT: setPackageFragment((Boolean)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__TYPE_LITERAL: setTypeLiteral(TYPE_LITERAL_EDEFAULT); return; case XbasePackage.XFEATURE_CALL__PACKAGE_FRAGMENT: setPackageFragment(PACKAGE_FRAGMENT_EDEFAULT); 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__TYPE_LITERAL: return typeLiteral != TYPE_LITERAL_EDEFAULT; case XbasePackage.XFEATURE_CALL__PACKAGE_FRAGMENT: return packageFragment != PACKAGE_FRAGMENT_EDEFAULT; } 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(", typeLiteral: "); result.append(typeLiteral); result.append(", packageFragment: "); result.append(packageFragment); result.append(')'); return result.toString(); } } //XFeatureCallImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy