| /* |
| * Copyright (c) 2005, 2006 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: MessageEndImpl.java,v 1.11 2006/11/14 18:02:15 khussey Exp $ |
| */ |
| package org.eclipse.uml2.uml.internal.impl; |
| |
| import java.util.Collection; |
| 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.uml2.uml.Message; |
| import org.eclipse.uml2.uml.MessageEnd; |
| import org.eclipse.uml2.uml.StringExpression; |
| import org.eclipse.uml2.uml.UMLPackage; |
| import org.eclipse.uml2.uml.VisibilityKind; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Message End</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.uml2.uml.internal.impl.MessageEndImpl#getMessage <em>Message</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public abstract class MessageEndImpl |
| extends NamedElementImpl |
| implements MessageEnd { |
| |
| /** |
| * The cached value of the '{@link #getMessage() <em>Message</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMessage() |
| * @generated |
| * @ordered |
| */ |
| protected Message message = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MessageEndImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return UMLPackage.Literals.MESSAGE_END; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Message getMessage() { |
| if (message != null && message.eIsProxy()) { |
| InternalEObject oldMessage = (InternalEObject) message; |
| message = (Message) eResolveProxy(oldMessage); |
| if (message != oldMessage) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, |
| UMLPackage.MESSAGE_END__MESSAGE, oldMessage, message)); |
| } |
| } |
| return message; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Message basicGetMessage() { |
| return message; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMessage(Message newMessage) { |
| |
| Message oldMessage = message; |
| message = newMessage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| UMLPackage.MESSAGE_END__MESSAGE, oldMessage, message)); |
| |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UMLPackage.MESSAGE_END__EANNOTATIONS : |
| return getEAnnotations(); |
| case UMLPackage.MESSAGE_END__OWNED_ELEMENT : |
| return getOwnedElements(); |
| case UMLPackage.MESSAGE_END__OWNER : |
| if (resolve) |
| return getOwner(); |
| return basicGetOwner(); |
| case UMLPackage.MESSAGE_END__OWNED_COMMENT : |
| return getOwnedComments(); |
| case UMLPackage.MESSAGE_END__NAME : |
| return getName(); |
| case UMLPackage.MESSAGE_END__VISIBILITY : |
| return getVisibility(); |
| case UMLPackage.MESSAGE_END__QUALIFIED_NAME : |
| return getQualifiedName(); |
| case UMLPackage.MESSAGE_END__CLIENT_DEPENDENCY : |
| return getClientDependencies(); |
| case UMLPackage.MESSAGE_END__NAMESPACE : |
| if (resolve) |
| return getNamespace(); |
| return basicGetNamespace(); |
| case UMLPackage.MESSAGE_END__NAME_EXPRESSION : |
| if (resolve) |
| return getNameExpression(); |
| return basicGetNameExpression(); |
| case UMLPackage.MESSAGE_END__MESSAGE : |
| if (resolve) |
| return getMessage(); |
| return basicGetMessage(); |
| } |
| return eDynamicGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case UMLPackage.MESSAGE_END__EANNOTATIONS : |
| getEAnnotations().clear(); |
| getEAnnotations().addAll((Collection) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__OWNED_COMMENT : |
| getOwnedComments().clear(); |
| getOwnedComments().addAll((Collection) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__NAME : |
| setName((String) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__VISIBILITY : |
| setVisibility((VisibilityKind) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__CLIENT_DEPENDENCY : |
| getClientDependencies().clear(); |
| getClientDependencies().addAll((Collection) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__NAME_EXPRESSION : |
| setNameExpression((StringExpression) newValue); |
| return; |
| case UMLPackage.MESSAGE_END__MESSAGE : |
| setMessage((Message) newValue); |
| return; |
| } |
| eDynamicSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UMLPackage.MESSAGE_END__EANNOTATIONS : |
| getEAnnotations().clear(); |
| return; |
| case UMLPackage.MESSAGE_END__OWNED_COMMENT : |
| getOwnedComments().clear(); |
| return; |
| case UMLPackage.MESSAGE_END__NAME : |
| unsetName(); |
| return; |
| case UMLPackage.MESSAGE_END__VISIBILITY : |
| unsetVisibility(); |
| return; |
| case UMLPackage.MESSAGE_END__CLIENT_DEPENDENCY : |
| getClientDependencies().clear(); |
| return; |
| case UMLPackage.MESSAGE_END__NAME_EXPRESSION : |
| setNameExpression((StringExpression) null); |
| return; |
| case UMLPackage.MESSAGE_END__MESSAGE : |
| setMessage((Message) null); |
| return; |
| } |
| eDynamicUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UMLPackage.MESSAGE_END__EANNOTATIONS : |
| return eAnnotations != null && !eAnnotations.isEmpty(); |
| case UMLPackage.MESSAGE_END__OWNED_ELEMENT : |
| return isSetOwnedElements(); |
| case UMLPackage.MESSAGE_END__OWNER : |
| return isSetOwner(); |
| case UMLPackage.MESSAGE_END__OWNED_COMMENT : |
| return ownedComments != null && !ownedComments.isEmpty(); |
| case UMLPackage.MESSAGE_END__NAME : |
| return isSetName(); |
| case UMLPackage.MESSAGE_END__VISIBILITY : |
| return isSetVisibility(); |
| case UMLPackage.MESSAGE_END__QUALIFIED_NAME : |
| return QUALIFIED_NAME_EDEFAULT == null |
| ? getQualifiedName() != null |
| : !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName()); |
| case UMLPackage.MESSAGE_END__CLIENT_DEPENDENCY : |
| return clientDependencies != null |
| && !clientDependencies.isEmpty(); |
| case UMLPackage.MESSAGE_END__NAMESPACE : |
| return isSetNamespace(); |
| case UMLPackage.MESSAGE_END__NAME_EXPRESSION : |
| return nameExpression != null; |
| case UMLPackage.MESSAGE_END__MESSAGE : |
| return message != null; |
| } |
| return eDynamicIsSet(featureID); |
| } |
| |
| } //MessageEndImpl |