/** | |
* Copyright (c) 2011-2012 Mia-Software. | |
* | |
* 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 | |
* | |
* Contributors: | |
* Gregoire Dupe (Mia-Software) - Design | |
* Nicolas Guyomar (Mia-Software) - Implementation | |
* Emmanuelle Rouillé (Mia-Software) - Bug 352618 - To be able to use non derived facet structural features and save them values. | |
* Nicolas Bros (Mia-Software) - Bug 361823 - [Restructuring] eFacet2 meta-model | |
* Gregoire Dupe (Mia-Software) - Bug 366055 - NavigationQuery | |
* Gregoire Dupe (Mia-Software) - Bug 369673 - [Facet] IsOneOfQuery | |
* Olivier Remaud (Soft-Maint) - Bug 369824 - Add a simple way to return string literal constants from a customization query | |
* Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework | |
* Gregoire Dupe (Mia-software) - Bug 364325 - [Restructuring] The user must be able to navigate into a model using the Facet. | |
* Nicolas Bros (Mia-Software) - Bug 372626 - [Facet] Aggregates | |
* Nicolas Bros (Mia-Software) - Bug 376941 - [EFacet] Facet operation arguments in Facet model | |
* | |
*/ | |
package org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.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.EOperation; | |
import org.eclipse.emf.ecore.ETypedElement; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.util.EObjectResolvingEList; | |
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; | |
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.impl.QueryImpl; | |
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.OperationCallQuery; | |
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.QueryPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Operation Call Query</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.impl.OperationCallQueryImpl#getOperation <em>Operation</em>}</li> | |
* <li>{@link org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.impl.OperationCallQueryImpl#getArguments <em>Arguments</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class OperationCallQueryImpl extends QueryImpl implements OperationCallQuery { | |
/** | |
* The cached value of the '{@link #getOperation() <em>Operation</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getOperation() | |
* @generated | |
* @ordered | |
*/ | |
protected EOperation operation; | |
/** | |
* The cached value of the '{@link #getArguments() <em>Arguments</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getArguments() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Query> arguments; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected OperationCallQueryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return QueryPackage.Literals.OPERATION_CALL_QUERY; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EOperation getOperation() { | |
if (operation != null && operation.eIsProxy()) { | |
InternalEObject oldOperation = (InternalEObject)operation; | |
operation = (EOperation)eResolveProxy(oldOperation); | |
if (operation != oldOperation) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, QueryPackage.OPERATION_CALL_QUERY__OPERATION, oldOperation, operation)); | |
} | |
} | |
return operation; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EOperation basicGetOperation() { | |
return operation; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setOperation(EOperation newOperation) { | |
EOperation oldOperation = operation; | |
operation = newOperation; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, QueryPackage.OPERATION_CALL_QUERY__OPERATION, oldOperation, operation)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EList<Query> getArguments() { | |
if (arguments == null) { | |
arguments = new EObjectContainmentEList<Query>(Query.class, this, QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS); | |
} | |
return arguments; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS: | |
return ((InternalEList<?>)getArguments()).basicRemove(otherEnd, msgs); | |
} | |
return super.eInverseRemove(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case QueryPackage.OPERATION_CALL_QUERY__OPERATION: | |
if (resolve) return getOperation(); | |
return basicGetOperation(); | |
case QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS: | |
return getArguments(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case QueryPackage.OPERATION_CALL_QUERY__OPERATION: | |
setOperation((EOperation)newValue); | |
return; | |
case QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS: | |
getArguments().clear(); | |
getArguments().addAll((Collection<? extends Query>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case QueryPackage.OPERATION_CALL_QUERY__OPERATION: | |
setOperation((EOperation)null); | |
return; | |
case QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS: | |
getArguments().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case QueryPackage.OPERATION_CALL_QUERY__OPERATION: | |
return operation != null; | |
case QueryPackage.OPERATION_CALL_QUERY__ARGUMENTS: | |
return arguments != null && !arguments.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //OperationCallQueryImpl |