blob: dd51d966b110f9e794049789297fb1f73cfadf3e [file] [log] [blame]
/*
* Copyright (c) 2005 IBM Corporation 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
*
* Contributors:
* IBM - initial API and implementation
*
* $Id: ActionExecutionSpecificationImpl.java,v 1.1 2005/11/14 22:26:06 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.impl;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.uml2.uml.Action;
import org.eclipse.uml2.uml.ActionExecutionSpecification;
import org.eclipse.uml2.uml.ExecutionOccurrenceSpecification;
import org.eclipse.uml2.uml.Interaction;
import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.VisibilityKind;
import org.eclipse.uml2.uml.internal.operations.ActionExecutionSpecificationOperations;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Action Execution Specification</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.uml2.uml.internal.impl.ActionExecutionSpecificationImpl#getAction <em>Action</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ActionExecutionSpecificationImpl
extends ExecutionSpecificationImpl
implements ActionExecutionSpecification {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ActionExecutionSpecificationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return UMLPackage.eINSTANCE.getActionExecutionSpecification();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action getAction() {
Action action = (Action) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION);
if (action != null && action.eIsProxy()) {
Action oldAction = action;
action = (Action) eResolveProxy((InternalEObject) action);
if (action != oldAction) {
eVirtualSet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION,
action);
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION,
oldAction, action));
}
}
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Action basicGetAction() {
return (Action) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAction(Action newAction) {
Action action = newAction;
Object oldAction = eVirtualSet(
UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION, action);
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION,
oldAction == EVIRTUAL_NO_VALUE
? null
: oldAction, action));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateActionReferenced(DiagnosticChain diagnostics,
Map context) {
return ActionExecutionSpecificationOperations.validateActionReferenced(
this, diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(EStructuralFeature eFeature, boolean resolve) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__EANNOTATIONS :
return getEAnnotations();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_ELEMENT :
return getOwnedElements();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNER :
if (resolve)
return getOwner();
return basicGetOwner();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_COMMENT :
return getOwnedComments();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME :
return getName();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY :
return getVisibility();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__QUALIFIED_NAME :
return getQualifiedName();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__CLIENT_DEPENDENCY :
return getClientDependencies();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAMESPACE :
if (resolve)
return getNamespace();
return basicGetNamespace();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME_EXPRESSION :
return getNameExpression();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__COVERED :
return getCovereds();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__GENERAL_ORDERING :
return getGeneralOrderings();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_INTERACTION :
return getEnclosingInteraction();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_OPERAND :
return getEnclosingOperand();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__START :
if (resolve)
return getStart();
return basicGetStart();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__FINISH :
if (resolve)
return getFinish();
return basicGetFinish();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION :
if (resolve)
return getAction();
return basicGetAction();
}
return eDynamicGet(eFeature, resolve);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(EStructuralFeature eFeature, Object newValue) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__EANNOTATIONS :
getEAnnotations().clear();
getEAnnotations().addAll((Collection) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_COMMENT :
getOwnedComments().clear();
getOwnedComments().addAll((Collection) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME :
setName((String) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY :
setVisibility((VisibilityKind) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
getClientDependencies().addAll((Collection) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME_EXPRESSION :
setNameExpression((StringExpression) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__COVERED :
getCovereds().clear();
getCovereds().addAll((Collection) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__GENERAL_ORDERING :
getGeneralOrderings().clear();
getGeneralOrderings().addAll((Collection) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_INTERACTION :
setEnclosingInteraction((Interaction) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_OPERAND :
setEnclosingOperand((InteractionOperand) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__START :
setStart((ExecutionOccurrenceSpecification) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__FINISH :
setFinish((ExecutionOccurrenceSpecification) newValue);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION :
setAction((Action) newValue);
return;
}
eDynamicSet(eFeature, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__EANNOTATIONS :
getEAnnotations().clear();
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_COMMENT :
getOwnedComments().clear();
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME :
setName(NAME_EDEFAULT);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY :
setVisibility(VISIBILITY_EDEFAULT);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME_EXPRESSION :
setNameExpression((StringExpression) null);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__COVERED :
getCovereds().clear();
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__GENERAL_ORDERING :
getGeneralOrderings().clear();
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_INTERACTION :
setEnclosingInteraction((Interaction) null);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_OPERAND :
setEnclosingOperand((InteractionOperand) null);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__START :
setStart((ExecutionOccurrenceSpecification) null);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__FINISH :
setFinish((ExecutionOccurrenceSpecification) null);
return;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION :
setAction((Action) null);
return;
}
eDynamicUnset(eFeature);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__EANNOTATIONS :
return eAnnotations != null && !eAnnotations.isEmpty();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_ELEMENT :
return isSetOwnedElements();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNER :
return isSetOwner();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_COMMENT :
List ownedComment = (List) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__OWNED_COMMENT);
return ownedComment != null && !ownedComment.isEmpty();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME :
String name = eVirtualIsSet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME)
? (String) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME)
: NAME_EDEFAULT;
return NAME_EDEFAULT == null
? name != null
: !NAME_EDEFAULT.equals(name);
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY :
return eVirtualIsSet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY)
&& eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__VISIBILITY) != VISIBILITY_EDEFAULT;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__QUALIFIED_NAME :
return QUALIFIED_NAME_EDEFAULT == null
? getQualifiedName() != null
: !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName());
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__CLIENT_DEPENDENCY :
List clientDependency = (List) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__CLIENT_DEPENDENCY);
return clientDependency != null && !clientDependency.isEmpty();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAMESPACE :
return isSetNamespace();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME_EXPRESSION :
return eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__NAME_EXPRESSION) != null;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__COVERED :
List covered = (List) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__COVERED);
return covered != null && !covered.isEmpty();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__GENERAL_ORDERING :
List generalOrdering = (List) eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__GENERAL_ORDERING);
return generalOrdering != null && !generalOrdering.isEmpty();
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_INTERACTION :
return getEnclosingInteraction() != null;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ENCLOSING_OPERAND :
return getEnclosingOperand() != null;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__START :
return eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__START) != null;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__FINISH :
return eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__FINISH) != null;
case UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION :
return eVirtualGet(UMLPackage.ACTION_EXECUTION_SPECIFICATION__ACTION) != null;
}
return eDynamicIsSet(eFeature);
}
} //ActionExecutionSpecificationImpl