blob: 08f229d4ce3b7b812f128e168f3e7768edde485d [file] [log] [blame]
/**
* Copyright (c) 2007, 2018 Borland Software Corporation and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Borland Software Corporation - initial API and implementation
*
* $Id: ResolveInExpImpl.java,v 1.5 2009/03/15 11:44:40 radvorak Exp $
*/
package org.eclipse.m2m.internal.qvt.oml.expressions.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.m2m.internal.qvt.oml.expressions.ExpressionsPackage;
import org.eclipse.m2m.internal.qvt.oml.expressions.MappingOperation;
import org.eclipse.m2m.internal.qvt.oml.expressions.ResolveInExp;
import org.eclipse.ocl.utilities.Visitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Resolve In Exp</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.m2m.internal.qvt.oml.expressions.impl.ResolveInExpImpl#getInMapping <em>In Mapping</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ResolveInExpImpl extends ResolveExpImpl implements ResolveInExp {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2007 Borland Software Corporation\r\n\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v2.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v20.html\r\n \r\nContributors:\r\n Borland Software Corporation - initial API and implementation"; //$NON-NLS-1$
/**
* The cached value of the '{@link #getInMapping() <em>In Mapping</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInMapping()
* @generated
* @ordered
*/
protected MappingOperation inMapping;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ResolveInExpImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionsPackage.Literals.RESOLVE_IN_EXP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingOperation getInMapping() {
if (inMapping != null && inMapping.eIsProxy()) {
InternalEObject oldInMapping = (InternalEObject)inMapping;
inMapping = (MappingOperation)eResolveProxy(oldInMapping);
if (inMapping != oldInMapping) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING, oldInMapping, inMapping));
}
}
return inMapping;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MappingOperation basicGetInMapping() {
return inMapping;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInMapping(MappingOperation newInMapping) {
MappingOperation oldInMapping = inMapping;
inMapping = newInMapping;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING, oldInMapping, inMapping));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {
if(v instanceof org.eclipse.m2m.internal.qvt.oml.expressions.util.QVTOperationalVisitor) {
@SuppressWarnings("unchecked")
org.eclipse.m2m.internal.qvt.oml.expressions.util.QVTOperationalVisitor<T> visitorExt = (org.eclipse.m2m.internal.qvt.oml.expressions.util.QVTOperationalVisitor) v;
return visitorExt.visitResolveInExp(this);
}
return org.eclipse.m2m.internal.qvt.oml.expressions.util.ForeignVisitorDefaultValue.getDefaultValueForVisitor(v);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING:
if (resolve) return getInMapping();
return basicGetInMapping();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING:
setInMapping((MappingOperation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING:
setInMapping((MappingOperation)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExpressionsPackage.RESOLVE_IN_EXP__IN_MAPPING:
return inMapping != null;
}
return super.eIsSet(featureID);
}
} //ResolveInExpImpl