blob: 683e70c011900593d3fb443b26d7da896c3b63ca [file] [log] [blame]
/*
* 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: StringExpressionImpl.java,v 1.21 2006/12/14 15:49:30 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.impl;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.common.util.DerivedUnionEObjectEList;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.ParameterableElement;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.TemplateBinding;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.TemplateSignature;
import org.eclipse.uml2.uml.TemplateableElement;
import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.ValueSpecification;
import org.eclipse.uml2.uml.VisibilityKind;
import org.eclipse.uml2.uml.internal.operations.StringExpressionOperations;
import org.eclipse.uml2.uml.internal.operations.TemplateableElementOperations;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>String Expression</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getOwnedElements <em>Owned Element</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getTemplateBindings <em>Template Binding</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getOwnedTemplateSignature <em>Owned Template Signature</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getOwner <em>Owner</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getSubExpressions <em>Sub Expression</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.StringExpressionImpl#getOwningExpression <em>Owning Expression</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StringExpressionImpl
extends ExpressionImpl
implements StringExpression {
/**
* The cached value of the '{@link #getTemplateBindings() <em>Template Binding</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTemplateBindings()
* @generated
* @ordered
*/
protected EList<TemplateBinding> templateBindings = null;
/**
* The cached value of the '{@link #getOwnedTemplateSignature() <em>Owned Template Signature</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedTemplateSignature()
* @generated
* @ordered
*/
protected TemplateSignature ownedTemplateSignature = null;
/**
* The cached value of the '{@link #getSubExpressions() <em>Sub Expression</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSubExpressions()
* @generated
* @ordered
*/
protected EList<StringExpression> subExpressions = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StringExpressionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLPackage.Literals.STRING_EXPRESSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Element> getOwnedElements() {
CacheAdapter cache = getCacheAdapter();
if (cache != null) {
Resource eResource = eResource();
@SuppressWarnings("unchecked")
EList<Element> ownedElements = (EList<Element>) cache.get(
eResource, this, UMLPackage.Literals.ELEMENT__OWNED_ELEMENT);
if (ownedElements == null) {
cache.put(eResource, this,
UMLPackage.Literals.ELEMENT__OWNED_ELEMENT,
ownedElements = new DerivedUnionEObjectEList<Element>(
Element.class, this,
UMLPackage.STRING_EXPRESSION__OWNED_ELEMENT,
OWNED_ELEMENT_ESUBSETS));
}
return ownedElements;
}
return new DerivedUnionEObjectEList<Element>(Element.class, this,
UMLPackage.STRING_EXPRESSION__OWNED_ELEMENT, OWNED_ELEMENT_ESUBSETS);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<TemplateBinding> getTemplateBindings() {
if (templateBindings == null) {
templateBindings = new EObjectContainmentWithInverseEList.Resolving<TemplateBinding>(
TemplateBinding.class, this,
UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING,
UMLPackage.TEMPLATE_BINDING__BOUND_ELEMENT);
}
return templateBindings;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateBinding createTemplateBinding(TemplateSignature signature) {
TemplateBinding newTemplateBinding = (TemplateBinding) create(UMLPackage.Literals.TEMPLATE_BINDING);
getTemplateBindings().add(newTemplateBinding);
if (signature != null)
newTemplateBinding.setSignature(signature);
return newTemplateBinding;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateBinding getTemplateBinding(TemplateSignature signature) {
return getTemplateBinding(signature, false);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateBinding getTemplateBinding(TemplateSignature signature,
boolean createOnDemand) {
templateBindingLoop : for (TemplateBinding templateBinding : getTemplateBindings()) {
if (signature != null
&& !signature.equals(templateBinding.getSignature()))
continue templateBindingLoop;
return templateBinding;
}
return createOnDemand
? createTemplateBinding(signature)
: null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateSignature getOwnedTemplateSignature() {
if (ownedTemplateSignature != null && ownedTemplateSignature.eIsProxy()) {
InternalEObject oldOwnedTemplateSignature = (InternalEObject) ownedTemplateSignature;
ownedTemplateSignature = (TemplateSignature) eResolveProxy(oldOwnedTemplateSignature);
if (ownedTemplateSignature != oldOwnedTemplateSignature) {
InternalEObject newOwnedTemplateSignature = (InternalEObject) ownedTemplateSignature;
NotificationChain msgs = oldOwnedTemplateSignature
.eInverseRemove(this,
UMLPackage.TEMPLATE_SIGNATURE__TEMPLATE,
TemplateSignature.class, null);
if (newOwnedTemplateSignature.eInternalContainer() == null) {
msgs = newOwnedTemplateSignature.eInverseAdd(this,
UMLPackage.TEMPLATE_SIGNATURE__TEMPLATE,
TemplateSignature.class, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE,
oldOwnedTemplateSignature, ownedTemplateSignature));
}
}
return ownedTemplateSignature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateSignature basicGetOwnedTemplateSignature() {
return ownedTemplateSignature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwnedTemplateSignature(
TemplateSignature newOwnedTemplateSignature, NotificationChain msgs) {
TemplateSignature oldOwnedTemplateSignature = ownedTemplateSignature;
ownedTemplateSignature = newOwnedTemplateSignature;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET,
UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE,
oldOwnedTemplateSignature, newOwnedTemplateSignature);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwnedTemplateSignature(
TemplateSignature newOwnedTemplateSignature) {
if (newOwnedTemplateSignature != ownedTemplateSignature) {
NotificationChain msgs = null;
if (ownedTemplateSignature != null)
msgs = ((InternalEObject) ownedTemplateSignature)
.eInverseRemove(this,
UMLPackage.TEMPLATE_SIGNATURE__TEMPLATE,
TemplateSignature.class, msgs);
if (newOwnedTemplateSignature != null)
msgs = ((InternalEObject) newOwnedTemplateSignature)
.eInverseAdd(this, UMLPackage.TEMPLATE_SIGNATURE__TEMPLATE,
TemplateSignature.class, msgs);
msgs = basicSetOwnedTemplateSignature(newOwnedTemplateSignature,
msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE,
newOwnedTemplateSignature, newOwnedTemplateSignature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateSignature createOwnedTemplateSignature(EClass eClass) {
TemplateSignature newOwnedTemplateSignature = (TemplateSignature) create(eClass);
setOwnedTemplateSignature(newOwnedTemplateSignature);
return newOwnedTemplateSignature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateSignature createOwnedTemplateSignature() {
return createOwnedTemplateSignature(UMLPackage.Literals.TEMPLATE_SIGNATURE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element getOwner() {
Element owner = basicGetOwner();
return owner != null && owner.eIsProxy()
? (Element) eResolveProxy((InternalEObject) owner)
: owner;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<StringExpression> getSubExpressions() {
if (subExpressions == null) {
subExpressions = new EObjectContainmentWithInverseEList.Resolving<StringExpression>(
StringExpression.class, this,
UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION,
UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION);
}
return subExpressions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StringExpression createSubExpression(String name, Type type) {
StringExpression newSubExpression = (StringExpression) create(UMLPackage.Literals.STRING_EXPRESSION);
getSubExpressions().add(newSubExpression);
if (name != null)
newSubExpression.setName(name);
if (type != null)
newSubExpression.setType(type);
return newSubExpression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StringExpression getSubExpression(String name, Type type) {
return getSubExpression(name, type, false, false);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StringExpression getSubExpression(String name, Type type,
boolean ignoreCase, boolean createOnDemand) {
subExpressionLoop : for (StringExpression subExpression : getSubExpressions()) {
if (name != null && !(ignoreCase
? name.equalsIgnoreCase(subExpression.getName())
: name.equals(subExpression.getName())))
continue subExpressionLoop;
if (type != null && !type.equals(subExpression.getType()))
continue subExpressionLoop;
return subExpression;
}
return createOnDemand
? createSubExpression(name, type)
: null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StringExpression getOwningExpression() {
if (eContainerFeatureID != UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION)
return null;
return (StringExpression) eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StringExpression basicGetOwningExpression() {
if (eContainerFeatureID != UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION)
return null;
return (StringExpression) eInternalContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwningExpression(
StringExpression newOwningExpression, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject) newOwningExpression,
UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwningExpression(StringExpression newOwningExpression) {
if (newOwningExpression != eInternalContainer()
|| (eContainerFeatureID != UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION && newOwningExpression != null)) {
if (EcoreUtil.isAncestor(this, newOwningExpression))
throw new IllegalArgumentException(
"Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwningExpression != null)
msgs = ((InternalEObject) newOwningExpression).eInverseAdd(
this, UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION,
StringExpression.class, msgs);
msgs = basicSetOwningExpression(newOwningExpression, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION,
newOwningExpression, newOwningExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ParameterableElement> parameterableElements() {
CacheAdapter cache = getCacheAdapter();
if (cache != null) {
@SuppressWarnings("unchecked")
EList<ParameterableElement> result = (EList<ParameterableElement>) cache
.get(this, UMLPackage.Literals.TEMPLATEABLE_ELEMENT
.getEOperations().get(0));
if (result == null) {
cache.put(this, UMLPackage.Literals.TEMPLATEABLE_ELEMENT
.getEOperations().get(0),
result = TemplateableElementOperations
.parameterableElements(this));
}
return result;
}
return TemplateableElementOperations.parameterableElements(this);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isTemplate() {
return TemplateableElementOperations.isTemplate(this);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateOperands(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return StringExpressionOperations.validateOperands(this, diagnostics,
context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateSubexpressions(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return StringExpressionOperations.validateSubexpressions(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String stringValue() {
return StringExpressionOperations.stringValue(this);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getEAnnotations())
.basicAdd(otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getClientDependencies())
.basicAdd(otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetOwningTemplateParameter(
(TemplateParameter) otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
if (templateParameter != null)
msgs = ((InternalEObject) templateParameter)
.eInverseRemove(this,
UMLPackage.TEMPLATE_PARAMETER__PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
return basicSetTemplateParameter((TemplateParameter) otherEnd,
msgs);
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getTemplateBindings())
.basicAdd(otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
if (ownedTemplateSignature != null)
msgs = ((InternalEObject) ownedTemplateSignature)
.eInverseRemove(
this,
EOPPOSITE_FEATURE_BASE
- UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE,
null, msgs);
return basicSetOwnedTemplateSignature(
(TemplateSignature) otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getSubExpressions())
.basicAdd(otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetOwningExpression((StringExpression) otherEnd,
msgs);
}
return eDynamicInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
return ((InternalEList<?>) getEAnnotations()).basicRemove(
otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNED_COMMENT :
return ((InternalEList<?>) getOwnedComments()).basicRemove(
otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
return ((InternalEList<?>) getClientDependencies())
.basicRemove(otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION :
return basicSetNameExpression(null, msgs);
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
return basicSetOwningTemplateParameter(null, msgs);
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
return basicSetTemplateParameter(null, msgs);
case UMLPackage.STRING_EXPRESSION__OPERAND :
return ((InternalEList<?>) getOperands()).basicRemove(otherEnd,
msgs);
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
return ((InternalEList<?>) getTemplateBindings()).basicRemove(
otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
return basicSetOwnedTemplateSignature(null, msgs);
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
return ((InternalEList<?>) getSubExpressions()).basicRemove(
otherEnd, msgs);
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
return basicSetOwningExpression(null, msgs);
}
return eDynamicInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(
NotificationChain msgs) {
switch (eContainerFeatureID) {
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
return eInternalContainer().eInverseRemove(this,
UMLPackage.TEMPLATE_PARAMETER__OWNED_PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
return eInternalContainer().eInverseRemove(this,
UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION,
StringExpression.class, msgs);
}
return eDynamicBasicRemoveFromContainer(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
return getEAnnotations();
case UMLPackage.STRING_EXPRESSION__OWNED_ELEMENT :
return getOwnedElements();
case UMLPackage.STRING_EXPRESSION__OWNER :
if (resolve)
return getOwner();
return basicGetOwner();
case UMLPackage.STRING_EXPRESSION__OWNED_COMMENT :
return getOwnedComments();
case UMLPackage.STRING_EXPRESSION__NAME :
return getName();
case UMLPackage.STRING_EXPRESSION__VISIBILITY :
return getVisibility();
case UMLPackage.STRING_EXPRESSION__QUALIFIED_NAME :
return getQualifiedName();
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
return getClientDependencies();
case UMLPackage.STRING_EXPRESSION__NAMESPACE :
if (resolve)
return getNamespace();
return basicGetNamespace();
case UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION :
if (resolve)
return getNameExpression();
return basicGetNameExpression();
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
if (resolve)
return getOwningTemplateParameter();
return basicGetOwningTemplateParameter();
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
if (resolve)
return getTemplateParameter();
return basicGetTemplateParameter();
case UMLPackage.STRING_EXPRESSION__TYPE :
if (resolve)
return getType();
return basicGetType();
case UMLPackage.STRING_EXPRESSION__SYMBOL :
return getSymbol();
case UMLPackage.STRING_EXPRESSION__OPERAND :
return getOperands();
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
return getTemplateBindings();
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
if (resolve)
return getOwnedTemplateSignature();
return basicGetOwnedTemplateSignature();
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
return getSubExpressions();
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
if (resolve)
return getOwningExpression();
return basicGetOwningExpression();
}
return eDynamicGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
getEAnnotations().clear();
getEAnnotations().addAll(
(Collection<? extends EAnnotation>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__OWNED_COMMENT :
getOwnedComments().clear();
getOwnedComments().addAll(
(Collection<? extends Comment>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__NAME :
setName((String) newValue);
return;
case UMLPackage.STRING_EXPRESSION__VISIBILITY :
setVisibility((VisibilityKind) newValue);
return;
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
getClientDependencies().addAll(
(Collection<? extends Dependency>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION :
setNameExpression((StringExpression) newValue);
return;
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.STRING_EXPRESSION__TYPE :
setType((Type) newValue);
return;
case UMLPackage.STRING_EXPRESSION__SYMBOL :
setSymbol((String) newValue);
return;
case UMLPackage.STRING_EXPRESSION__OPERAND :
getOperands().clear();
getOperands().addAll(
(Collection<? extends ValueSpecification>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
getTemplateBindings().clear();
getTemplateBindings().addAll(
(Collection<? extends TemplateBinding>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
setOwnedTemplateSignature((TemplateSignature) newValue);
return;
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
getSubExpressions().clear();
getSubExpressions().addAll(
(Collection<? extends StringExpression>) newValue);
return;
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
setOwningExpression((StringExpression) newValue);
return;
}
eDynamicSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
getEAnnotations().clear();
return;
case UMLPackage.STRING_EXPRESSION__OWNED_COMMENT :
getOwnedComments().clear();
return;
case UMLPackage.STRING_EXPRESSION__NAME :
unsetName();
return;
case UMLPackage.STRING_EXPRESSION__VISIBILITY :
unsetVisibility();
return;
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
return;
case UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION :
setNameExpression((StringExpression) null);
return;
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.STRING_EXPRESSION__TYPE :
setType((Type) null);
return;
case UMLPackage.STRING_EXPRESSION__SYMBOL :
unsetSymbol();
return;
case UMLPackage.STRING_EXPRESSION__OPERAND :
getOperands().clear();
return;
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
getTemplateBindings().clear();
return;
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
setOwnedTemplateSignature((TemplateSignature) null);
return;
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
getSubExpressions().clear();
return;
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
setOwningExpression((StringExpression) null);
return;
}
eDynamicUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UMLPackage.STRING_EXPRESSION__EANNOTATIONS :
return eAnnotations != null && !eAnnotations.isEmpty();
case UMLPackage.STRING_EXPRESSION__OWNED_ELEMENT :
return isSetOwnedElements();
case UMLPackage.STRING_EXPRESSION__OWNER :
return isSetOwner();
case UMLPackage.STRING_EXPRESSION__OWNED_COMMENT :
return ownedComments != null && !ownedComments.isEmpty();
case UMLPackage.STRING_EXPRESSION__NAME :
return isSetName();
case UMLPackage.STRING_EXPRESSION__VISIBILITY :
return isSetVisibility();
case UMLPackage.STRING_EXPRESSION__QUALIFIED_NAME :
return QUALIFIED_NAME_EDEFAULT == null
? getQualifiedName() != null
: !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName());
case UMLPackage.STRING_EXPRESSION__CLIENT_DEPENDENCY :
return clientDependencies != null
&& !clientDependencies.isEmpty();
case UMLPackage.STRING_EXPRESSION__NAMESPACE :
return isSetNamespace();
case UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION :
return nameExpression != null;
case UMLPackage.STRING_EXPRESSION__OWNING_TEMPLATE_PARAMETER :
return basicGetOwningTemplateParameter() != null;
case UMLPackage.STRING_EXPRESSION__TEMPLATE_PARAMETER :
return templateParameter != null;
case UMLPackage.STRING_EXPRESSION__TYPE :
return type != null;
case UMLPackage.STRING_EXPRESSION__SYMBOL :
return isSetSymbol();
case UMLPackage.STRING_EXPRESSION__OPERAND :
return operands != null && !operands.isEmpty();
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
return templateBindings != null && !templateBindings.isEmpty();
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
return ownedTemplateSignature != null;
case UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION :
return subExpressions != null && !subExpressions.isEmpty();
case UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION :
return basicGetOwningExpression() != null;
}
return eDynamicIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
if (baseClass == TemplateableElement.class) {
switch (derivedFeatureID) {
case UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING :
return UMLPackage.TEMPLATEABLE_ELEMENT__TEMPLATE_BINDING;
case UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE :
return UMLPackage.TEMPLATEABLE_ELEMENT__OWNED_TEMPLATE_SIGNATURE;
default :
return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
if (baseClass == TemplateableElement.class) {
switch (baseFeatureID) {
case UMLPackage.TEMPLATEABLE_ELEMENT__TEMPLATE_BINDING :
return UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING;
case UMLPackage.TEMPLATEABLE_ELEMENT__OWNED_TEMPLATE_SIGNATURE :
return UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE;
default :
return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
* The array of subset feature identifiers for the '{@link #getOwnedElements() <em>Owned Element</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedElements()
* @generated
* @ordered
*/
protected static final int[] OWNED_ELEMENT_ESUBSETS = new int[]{
UMLPackage.STRING_EXPRESSION__OWNED_COMMENT,
UMLPackage.STRING_EXPRESSION__NAME_EXPRESSION,
UMLPackage.STRING_EXPRESSION__OPERAND,
UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING,
UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE,
UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwnedElements() {
return super.isSetOwnedElements()
|| eIsSet(UMLPackage.STRING_EXPRESSION__TEMPLATE_BINDING)
|| eIsSet(UMLPackage.STRING_EXPRESSION__OWNED_TEMPLATE_SIGNATURE)
|| eIsSet(UMLPackage.STRING_EXPRESSION__SUB_EXPRESSION);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element basicGetOwner() {
StringExpression owningExpression = basicGetOwningExpression();
if (owningExpression != null) {
return owningExpression;
}
return super.basicGetOwner();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwner() {
return super.isSetOwner()
|| eIsSet(UMLPackage.STRING_EXPRESSION__OWNING_EXPRESSION);
}
} //StringExpressionImpl