mirror of
http://172.16.200.102/MOISE/Pattern-Instanciation-On-System-Engineering-Model.git
synced 2025-11-26 07:07:59 +01:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,289 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BooleanProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Boolean Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.BooleanPropertyImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.BooleanPropertyImpl#getKey <em>Key</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.BooleanPropertyImpl#isValue <em>Value</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class BooleanPropertyImpl extends MinimalEObjectImpl.Container implements BooleanProperty {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String KEY_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String key = KEY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #isValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final boolean VALUE_EDEFAULT = false;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #isValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean value = VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected BooleanPropertyImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.BOOLEAN_PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setKey(String newKey) {
|
||||
String oldKey = key;
|
||||
key = newKey;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.BOOLEAN_PROPERTY__KEY, oldKey, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setValue(boolean newValue) {
|
||||
boolean oldValue = value;
|
||||
value = newValue;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.BOOLEAN_PROPERTY__VALUE, oldValue,
|
||||
value));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.BOOLEAN_PROPERTY__UID:
|
||||
return getUid();
|
||||
case SeimPackage.BOOLEAN_PROPERTY__KEY:
|
||||
return getKey();
|
||||
case SeimPackage.BOOLEAN_PROPERTY__VALUE:
|
||||
return isValue();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.BOOLEAN_PROPERTY__KEY:
|
||||
setKey((String) newValue);
|
||||
return;
|
||||
case SeimPackage.BOOLEAN_PROPERTY__VALUE:
|
||||
setValue((Boolean) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.BOOLEAN_PROPERTY__KEY:
|
||||
setKey(KEY_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.BOOLEAN_PROPERTY__VALUE:
|
||||
setValue(VALUE_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.BOOLEAN_PROPERTY__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.BOOLEAN_PROPERTY__KEY:
|
||||
return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
|
||||
case SeimPackage.BOOLEAN_PROPERTY__VALUE:
|
||||
return value != VALUE_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", key: ");
|
||||
result.append(key);
|
||||
result.append(", value: ");
|
||||
result.append(value);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //BooleanPropertyImpl
|
||||
@@ -0,0 +1,330 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Component</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ComponentImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ComponentImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ComponentImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ComponentImpl#getContent <em>Content</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ComponentImpl extends MinimalEObjectImpl.Container implements Component {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getContent() <em>Content</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getContent()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Element> content;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ComponentImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.COMPONENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.COMPONENT__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, SeimPackage.COMPONENT__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Element> getContent() {
|
||||
if (content == null) {
|
||||
content = new EObjectContainmentEList<Element>(Element.class, this, SeimPackage.COMPONENT__CONTENT);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).basicRemove(otherEnd, msgs);
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
return ((InternalEList<?>) getContent()).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 SeimPackage.COMPONENT__UID:
|
||||
return getUid();
|
||||
case SeimPackage.COMPONENT__NAME:
|
||||
return getName();
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
return getProperties();
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
return getContent();
|
||||
}
|
||||
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 SeimPackage.COMPONENT__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
getContent().clear();
|
||||
getContent().addAll((Collection<? extends Element>) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.COMPONENT__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
getContent().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.COMPONENT__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.COMPONENT__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case SeimPackage.COMPONENT__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case SeimPackage.COMPONENT__CONTENT:
|
||||
return content != null && !content.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ComponentImpl
|
||||
@@ -0,0 +1,289 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.IntegerProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Integer Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.IntegerPropertyImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.IntegerPropertyImpl#getKey <em>Key</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.IntegerPropertyImpl#getValue <em>Value</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class IntegerPropertyImpl extends MinimalEObjectImpl.Container implements IntegerProperty {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String KEY_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String key = KEY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final int VALUE_EDEFAULT = 0;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected int value = VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected IntegerPropertyImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.INTEGER_PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setKey(String newKey) {
|
||||
String oldKey = key;
|
||||
key = newKey;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.INTEGER_PROPERTY__KEY, oldKey, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setValue(int newValue) {
|
||||
int oldValue = value;
|
||||
value = newValue;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.INTEGER_PROPERTY__VALUE, oldValue,
|
||||
value));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.INTEGER_PROPERTY__UID:
|
||||
return getUid();
|
||||
case SeimPackage.INTEGER_PROPERTY__KEY:
|
||||
return getKey();
|
||||
case SeimPackage.INTEGER_PROPERTY__VALUE:
|
||||
return getValue();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.INTEGER_PROPERTY__KEY:
|
||||
setKey((String) newValue);
|
||||
return;
|
||||
case SeimPackage.INTEGER_PROPERTY__VALUE:
|
||||
setValue((Integer) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.INTEGER_PROPERTY__KEY:
|
||||
setKey(KEY_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.INTEGER_PROPERTY__VALUE:
|
||||
setValue(VALUE_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.INTEGER_PROPERTY__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.INTEGER_PROPERTY__KEY:
|
||||
return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
|
||||
case SeimPackage.INTEGER_PROPERTY__VALUE:
|
||||
return value != VALUE_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", key: ");
|
||||
result.append(key);
|
||||
result.append(", value: ");
|
||||
result.append(value);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //IntegerPropertyImpl
|
||||
@@ -0,0 +1,416 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Link</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.LinkImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.LinkImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.LinkImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.LinkImpl#getSrc <em>Src</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.LinkImpl#getDst <em>Dst</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class LinkImpl extends MinimalEObjectImpl.Container implements Link {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getSrc() <em>Src</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getSrc()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Port src;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDst() <em>Dst</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDst()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Port dst;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected LinkImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.LINK;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.LINK__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, SeimPackage.LINK__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port getSrc() {
|
||||
if (src != null && src.eIsProxy()) {
|
||||
InternalEObject oldSrc = (InternalEObject) src;
|
||||
src = (Port) eResolveProxy(oldSrc);
|
||||
if (src != oldSrc) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SeimPackage.LINK__SRC, oldSrc, src));
|
||||
}
|
||||
}
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port basicGetSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setSrc(Port newSrc) {
|
||||
Port oldSrc = src;
|
||||
src = newSrc;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.LINK__SRC, oldSrc, src));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port getDst() {
|
||||
if (dst != null && dst.eIsProxy()) {
|
||||
InternalEObject oldDst = (InternalEObject) dst;
|
||||
dst = (Port) eResolveProxy(oldDst);
|
||||
if (dst != oldDst) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SeimPackage.LINK__DST, oldDst, dst));
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Port basicGetDst() {
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDst(Port newDst) {
|
||||
Port oldDst = dst;
|
||||
dst = newDst;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.LINK__DST, oldDst, dst));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).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 SeimPackage.LINK__UID:
|
||||
return getUid();
|
||||
case SeimPackage.LINK__NAME:
|
||||
return getName();
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
return getProperties();
|
||||
case SeimPackage.LINK__SRC:
|
||||
if (resolve)
|
||||
return getSrc();
|
||||
return basicGetSrc();
|
||||
case SeimPackage.LINK__DST:
|
||||
if (resolve)
|
||||
return getDst();
|
||||
return basicGetDst();
|
||||
}
|
||||
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 SeimPackage.LINK__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case SeimPackage.LINK__SRC:
|
||||
setSrc((Port) newValue);
|
||||
return;
|
||||
case SeimPackage.LINK__DST:
|
||||
setDst((Port) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.LINK__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case SeimPackage.LINK__SRC:
|
||||
setSrc((Port) null);
|
||||
return;
|
||||
case SeimPackage.LINK__DST:
|
||||
setDst((Port) null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.LINK__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.LINK__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case SeimPackage.LINK__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case SeimPackage.LINK__SRC:
|
||||
return src != null;
|
||||
case SeimPackage.LINK__DST:
|
||||
return dst != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //LinkImpl
|
||||
@@ -0,0 +1,331 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ModelImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ModelImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ModelImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ModelImpl#getModelElements <em>Model Elements</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ModelImpl extends MinimalEObjectImpl.Container implements Model {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getModelElements() <em>Model Elements</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getModelElements()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<GraphElement> modelElements;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.MODEL__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, SeimPackage.MODEL__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<GraphElement> getModelElements() {
|
||||
if (modelElements == null) {
|
||||
modelElements = new EObjectContainmentEList<GraphElement>(GraphElement.class, this,
|
||||
SeimPackage.MODEL__MODEL_ELEMENTS);
|
||||
}
|
||||
return modelElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).basicRemove(otherEnd, msgs);
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
return ((InternalEList<?>) getModelElements()).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 SeimPackage.MODEL__UID:
|
||||
return getUid();
|
||||
case SeimPackage.MODEL__NAME:
|
||||
return getName();
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
return getProperties();
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
return getModelElements();
|
||||
}
|
||||
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 SeimPackage.MODEL__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
getModelElements().clear();
|
||||
getModelElements().addAll((Collection<? extends GraphElement>) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.MODEL__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
getModelElements().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.MODEL__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.MODEL__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case SeimPackage.MODEL__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case SeimPackage.MODEL__MODEL_ELEMENTS:
|
||||
return modelElements != null && !modelElements.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ModelImpl
|
||||
@@ -0,0 +1,349 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PortDirection;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Port</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.PortImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.PortImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.PortImpl#getProperties <em>Properties</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.PortImpl#getDirection <em>Direction</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PortImpl extends MinimalEObjectImpl.Container implements Port {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getDirection() <em>Direction</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDirection()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final PortDirection DIRECTION_EDEFAULT = PortDirection.UNSPECIFIED;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getDirection()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PortDirection direction = DIRECTION_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PortImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.PORT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName) {
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.PORT__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties() {
|
||||
if (properties == null) {
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, SeimPackage.PORT__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PortDirection getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setDirection(PortDirection newDirection) {
|
||||
PortDirection oldDirection = direction;
|
||||
direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.PORT__DIRECTION, oldDirection,
|
||||
direction));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
return ((InternalEList<?>) getProperties()).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 SeimPackage.PORT__UID:
|
||||
return getUid();
|
||||
case SeimPackage.PORT__NAME:
|
||||
return getName();
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
return getProperties();
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
return getDirection();
|
||||
}
|
||||
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 SeimPackage.PORT__NAME:
|
||||
setName((String) newValue);
|
||||
return;
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>) newValue);
|
||||
return;
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
setDirection((PortDirection) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.PORT__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
setDirection(DIRECTION_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.PORT__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.PORT__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case SeimPackage.PORT__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
case SeimPackage.PORT__DIRECTION:
|
||||
return direction != DIRECTION_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", name: ");
|
||||
result.append(name);
|
||||
result.append(", direction: ");
|
||||
result.append(direction);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PortImpl
|
||||
@@ -0,0 +1,298 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
import com.irtsaintexupery.pseim.seim.ReferenceProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
|
||||
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.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Reference Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ReferencePropertyImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ReferencePropertyImpl#getKey <em>Key</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.ReferencePropertyImpl#getRef <em>Ref</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ReferencePropertyImpl extends MinimalEObjectImpl.Container implements ReferenceProperty {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String KEY_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String key = KEY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getRef() <em>Ref</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getRef()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected PropertyHolder ref;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ReferencePropertyImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.REFERENCE_PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setKey(String newKey) {
|
||||
String oldKey = key;
|
||||
key = newKey;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.REFERENCE_PROPERTY__KEY, oldKey, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder getRef() {
|
||||
if (ref != null && ref.eIsProxy()) {
|
||||
InternalEObject oldRef = (InternalEObject) ref;
|
||||
ref = (PropertyHolder) eResolveProxy(oldRef);
|
||||
if (ref != oldRef) {
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SeimPackage.REFERENCE_PROPERTY__REF,
|
||||
oldRef, ref));
|
||||
}
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PropertyHolder basicGetRef() {
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setRef(PropertyHolder newRef) {
|
||||
PropertyHolder oldRef = ref;
|
||||
ref = newRef;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.REFERENCE_PROPERTY__REF, oldRef, ref));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.REFERENCE_PROPERTY__UID:
|
||||
return getUid();
|
||||
case SeimPackage.REFERENCE_PROPERTY__KEY:
|
||||
return getKey();
|
||||
case SeimPackage.REFERENCE_PROPERTY__REF:
|
||||
if (resolve)
|
||||
return getRef();
|
||||
return basicGetRef();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.REFERENCE_PROPERTY__KEY:
|
||||
setKey((String) newValue);
|
||||
return;
|
||||
case SeimPackage.REFERENCE_PROPERTY__REF:
|
||||
setRef((PropertyHolder) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.REFERENCE_PROPERTY__KEY:
|
||||
setKey(KEY_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.REFERENCE_PROPERTY__REF:
|
||||
setRef((PropertyHolder) null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.REFERENCE_PROPERTY__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.REFERENCE_PROPERTY__KEY:
|
||||
return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
|
||||
case SeimPackage.REFERENCE_PROPERTY__REF:
|
||||
return ref != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", key: ");
|
||||
result.append(key);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ReferencePropertyImpl
|
||||
@@ -0,0 +1,254 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.*;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EDataType;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class SeimFactoryImpl extends EFactoryImpl implements SeimFactory {
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static SeimFactory init() {
|
||||
try {
|
||||
SeimFactory theSeimFactory = (SeimFactory) EPackage.Registry.INSTANCE.getEFactory(SeimPackage.eNS_URI);
|
||||
if (theSeimFactory != null) {
|
||||
return theSeimFactory;
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new SeimFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SeimFactoryImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass) {
|
||||
switch (eClass.getClassifierID()) {
|
||||
case SeimPackage.COMPONENT:
|
||||
return createComponent();
|
||||
case SeimPackage.PORT:
|
||||
return createPort();
|
||||
case SeimPackage.LINK:
|
||||
return createLink();
|
||||
case SeimPackage.INTEGER_PROPERTY:
|
||||
return createIntegerProperty();
|
||||
case SeimPackage.STRING_PROPERTY:
|
||||
return createStringProperty();
|
||||
case SeimPackage.BOOLEAN_PROPERTY:
|
||||
return createBooleanProperty();
|
||||
case SeimPackage.REFERENCE_PROPERTY:
|
||||
return createReferenceProperty();
|
||||
case SeimPackage.MODEL:
|
||||
return createModel();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object createFromString(EDataType eDataType, String initialValue) {
|
||||
switch (eDataType.getClassifierID()) {
|
||||
case SeimPackage.PORT_DIRECTION:
|
||||
return createPortDirectionFromString(eDataType, initialValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String convertToString(EDataType eDataType, Object instanceValue) {
|
||||
switch (eDataType.getClassifierID()) {
|
||||
case SeimPackage.PORT_DIRECTION:
|
||||
return convertPortDirectionToString(eDataType, instanceValue);
|
||||
default:
|
||||
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public Component createComponent() {
|
||||
ComponentImpl component = new ComponentImpl();
|
||||
component.uid = EcoreUtil.generateUUID();
|
||||
return component;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public Port createPort() {
|
||||
PortImpl port = new PortImpl();
|
||||
port.uid = EcoreUtil.generateUUID();
|
||||
return port;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public Link createLink() {
|
||||
LinkImpl link = new LinkImpl();
|
||||
link.uid = EcoreUtil.generateUUID();
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public IntegerProperty createIntegerProperty() {
|
||||
IntegerPropertyImpl integerProperty = new IntegerPropertyImpl();
|
||||
integerProperty.uid = EcoreUtil.generateUUID();
|
||||
return integerProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public StringProperty createStringProperty() {
|
||||
StringPropertyImpl stringProperty = new StringPropertyImpl();
|
||||
stringProperty.uid = EcoreUtil.generateUUID();
|
||||
return stringProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public BooleanProperty createBooleanProperty() {
|
||||
BooleanPropertyImpl booleanProperty = new BooleanPropertyImpl();
|
||||
booleanProperty.uid = EcoreUtil.generateUUID();
|
||||
return booleanProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public ReferenceProperty createReferenceProperty() {
|
||||
ReferencePropertyImpl referenceProperty = new ReferencePropertyImpl();
|
||||
referenceProperty.uid = EcoreUtil.generateUUID();
|
||||
return referenceProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated NOT
|
||||
*/
|
||||
public Model createModel() {
|
||||
ModelImpl model = new ModelImpl();
|
||||
model.uid = EcoreUtil.generateUUID();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PortDirection createPortDirectionFromString(EDataType eDataType, String initialValue) {
|
||||
PortDirection result = PortDirection.get(initialValue);
|
||||
if (result == null)
|
||||
throw new IllegalArgumentException(
|
||||
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String convertPortDirectionToString(EDataType eDataType, Object instanceValue) {
|
||||
return instanceValue == null ? null : instanceValue.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SeimPackage getSeimPackage() {
|
||||
return (SeimPackage) getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static SeimPackage getPackage() {
|
||||
return SeimPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //SeimFactoryImpl
|
||||
@@ -0,0 +1,778 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.BasicProperty;
|
||||
import com.irtsaintexupery.pseim.seim.BooleanProperty;
|
||||
import com.irtsaintexupery.pseim.seim.BorderElement;
|
||||
import com.irtsaintexupery.pseim.seim.Component;
|
||||
import com.irtsaintexupery.pseim.seim.Element;
|
||||
import com.irtsaintexupery.pseim.seim.GraphElement;
|
||||
import com.irtsaintexupery.pseim.seim.IdentifiedElement;
|
||||
import com.irtsaintexupery.pseim.seim.IntegerProperty;
|
||||
import com.irtsaintexupery.pseim.seim.Link;
|
||||
import com.irtsaintexupery.pseim.seim.Model;
|
||||
import com.irtsaintexupery.pseim.seim.NamedElement;
|
||||
import com.irtsaintexupery.pseim.seim.Port;
|
||||
import com.irtsaintexupery.pseim.seim.PortDirection;
|
||||
import com.irtsaintexupery.pseim.seim.Property;
|
||||
import com.irtsaintexupery.pseim.seim.PropertyHolder;
|
||||
import com.irtsaintexupery.pseim.seim.ReferenceProperty;
|
||||
import com.irtsaintexupery.pseim.seim.SeimFactory;
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
import com.irtsaintexupery.pseim.seim.StringProperty;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.util.SeimValidator;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EEnum;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
import org.eclipse.emf.ecore.EValidator;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class SeimPackageImpl extends EPackageImpl implements SeimPackage {
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass componentEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass portEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass linkEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass graphElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass propertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass basicPropertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass integerPropertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass stringPropertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass booleanPropertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass referencePropertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass propertyHolderEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass namedElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass identifiedElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass modelEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass borderElementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass elementEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EEnum portDirectionEEnum = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see com.irtsaintexupery.pseim.seim.SeimPackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private SeimPackageImpl() {
|
||||
super(eNS_URI, SeimFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link SeimPackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static SeimPackage init() {
|
||||
if (isInited)
|
||||
return (SeimPackage) EPackage.Registry.INSTANCE.getEPackage(SeimPackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
SeimPackageImpl theSeimPackage = (SeimPackageImpl) (EPackage.Registry.INSTANCE
|
||||
.get(eNS_URI) instanceof SeimPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
|
||||
: new SeimPackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Create package meta-data objects
|
||||
theSeimPackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theSeimPackage.initializePackageContents();
|
||||
|
||||
// Register package validator
|
||||
EValidator.Registry.INSTANCE.put(theSeimPackage, new EValidator.Descriptor() {
|
||||
public EValidator getEValidator() {
|
||||
return SeimValidator.INSTANCE;
|
||||
}
|
||||
});
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theSeimPackage.freeze();
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(SeimPackage.eNS_URI, theSeimPackage);
|
||||
return theSeimPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getComponent() {
|
||||
return componentEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getComponent_Content() {
|
||||
return (EReference) componentEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPort() {
|
||||
return portEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPort_Direction() {
|
||||
return (EAttribute) portEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getLink() {
|
||||
return linkEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getLink_Src() {
|
||||
return (EReference) linkEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getLink_Dst() {
|
||||
return (EReference) linkEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getGraphElement() {
|
||||
return graphElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getProperty() {
|
||||
return propertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Key() {
|
||||
return (EAttribute) propertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getBasicProperty() {
|
||||
return basicPropertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getIntegerProperty() {
|
||||
return integerPropertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getIntegerProperty_Value() {
|
||||
return (EAttribute) integerPropertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getStringProperty() {
|
||||
return stringPropertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getStringProperty_Value() {
|
||||
return (EAttribute) stringPropertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getBooleanProperty() {
|
||||
return booleanPropertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getBooleanProperty_Value() {
|
||||
return (EAttribute) booleanPropertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getReferenceProperty() {
|
||||
return referencePropertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getReferenceProperty_Ref() {
|
||||
return (EReference) referencePropertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPropertyHolder() {
|
||||
return propertyHolderEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getPropertyHolder_Properties() {
|
||||
return (EReference) propertyHolderEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getNamedElement() {
|
||||
return namedElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getNamedElement_Name() {
|
||||
return (EAttribute) namedElementEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getIdentifiedElement() {
|
||||
return identifiedElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getIdentifiedElement_Uid() {
|
||||
return (EAttribute) identifiedElementEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getModel() {
|
||||
return modelEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_ModelElements() {
|
||||
return (EReference) modelEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getBorderElement() {
|
||||
return borderElementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getElement() {
|
||||
return elementEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EEnum getPortDirection() {
|
||||
return portDirectionEEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SeimFactory getSeimFactory() {
|
||||
return (SeimFactory) getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents() {
|
||||
if (isCreated)
|
||||
return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
componentEClass = createEClass(COMPONENT);
|
||||
createEReference(componentEClass, COMPONENT__CONTENT);
|
||||
|
||||
portEClass = createEClass(PORT);
|
||||
createEAttribute(portEClass, PORT__DIRECTION);
|
||||
|
||||
linkEClass = createEClass(LINK);
|
||||
createEReference(linkEClass, LINK__SRC);
|
||||
createEReference(linkEClass, LINK__DST);
|
||||
|
||||
graphElementEClass = createEClass(GRAPH_ELEMENT);
|
||||
|
||||
propertyEClass = createEClass(PROPERTY);
|
||||
createEAttribute(propertyEClass, PROPERTY__KEY);
|
||||
|
||||
basicPropertyEClass = createEClass(BASIC_PROPERTY);
|
||||
|
||||
integerPropertyEClass = createEClass(INTEGER_PROPERTY);
|
||||
createEAttribute(integerPropertyEClass, INTEGER_PROPERTY__VALUE);
|
||||
|
||||
stringPropertyEClass = createEClass(STRING_PROPERTY);
|
||||
createEAttribute(stringPropertyEClass, STRING_PROPERTY__VALUE);
|
||||
|
||||
booleanPropertyEClass = createEClass(BOOLEAN_PROPERTY);
|
||||
createEAttribute(booleanPropertyEClass, BOOLEAN_PROPERTY__VALUE);
|
||||
|
||||
referencePropertyEClass = createEClass(REFERENCE_PROPERTY);
|
||||
createEReference(referencePropertyEClass, REFERENCE_PROPERTY__REF);
|
||||
|
||||
propertyHolderEClass = createEClass(PROPERTY_HOLDER);
|
||||
createEReference(propertyHolderEClass, PROPERTY_HOLDER__PROPERTIES);
|
||||
|
||||
namedElementEClass = createEClass(NAMED_ELEMENT);
|
||||
createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME);
|
||||
|
||||
identifiedElementEClass = createEClass(IDENTIFIED_ELEMENT);
|
||||
createEAttribute(identifiedElementEClass, IDENTIFIED_ELEMENT__UID);
|
||||
|
||||
modelEClass = createEClass(MODEL);
|
||||
createEReference(modelEClass, MODEL__MODEL_ELEMENTS);
|
||||
|
||||
borderElementEClass = createEClass(BORDER_ELEMENT);
|
||||
|
||||
elementEClass = createEClass(ELEMENT);
|
||||
|
||||
// Create enums
|
||||
portDirectionEEnum = createEEnum(PORT_DIRECTION);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents() {
|
||||
if (isInitialized)
|
||||
return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
componentEClass.getESuperTypes().add(this.getGraphElement());
|
||||
portEClass.getESuperTypes().add(this.getBorderElement());
|
||||
linkEClass.getESuperTypes().add(this.getGraphElement());
|
||||
graphElementEClass.getESuperTypes().add(this.getElement());
|
||||
propertyEClass.getESuperTypes().add(this.getIdentifiedElement());
|
||||
basicPropertyEClass.getESuperTypes().add(this.getProperty());
|
||||
integerPropertyEClass.getESuperTypes().add(this.getBasicProperty());
|
||||
stringPropertyEClass.getESuperTypes().add(this.getBasicProperty());
|
||||
booleanPropertyEClass.getESuperTypes().add(this.getBasicProperty());
|
||||
referencePropertyEClass.getESuperTypes().add(this.getProperty());
|
||||
propertyHolderEClass.getESuperTypes().add(this.getNamedElement());
|
||||
namedElementEClass.getESuperTypes().add(this.getIdentifiedElement());
|
||||
modelEClass.getESuperTypes().add(this.getPropertyHolder());
|
||||
borderElementEClass.getESuperTypes().add(this.getElement());
|
||||
elementEClass.getESuperTypes().add(this.getPropertyHolder());
|
||||
|
||||
// Initialize classes, features, and operations; add parameters
|
||||
initEClass(componentEClass, Component.class, "Component", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getComponent_Content(), this.getElement(), null, "content", null, 0, -1, Component.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
|
||||
IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(portEClass, Port.class, "Port", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPort_Direction(), this.getPortDirection(), "direction", null, 1, 1, Port.class, !IS_TRANSIENT,
|
||||
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(linkEClass, Link.class, "Link", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getLink_Src(), this.getPort(), null, "src", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE,
|
||||
IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getLink_Dst(), this.getPort(), null, "dst", null, 0, 1, Link.class, !IS_TRANSIENT, !IS_VOLATILE,
|
||||
IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(graphElementEClass, GraphElement.class, "GraphElement", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(propertyEClass, Property.class, "Property", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getProperty_Key(), ecorePackage.getEString(), "key", null, 1, 1, Property.class, !IS_TRANSIENT,
|
||||
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(basicPropertyEClass, BasicProperty.class, "BasicProperty", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(integerPropertyEClass, IntegerProperty.class, "IntegerProperty", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getIntegerProperty_Value(), ecorePackage.getEInt(), "value", "0", 1, 1, IntegerProperty.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(stringPropertyEClass, StringProperty.class, "StringProperty", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getStringProperty_Value(), ecorePackage.getEString(), "value", "\'\'", 1, 1,
|
||||
StringProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(booleanPropertyEClass, BooleanProperty.class, "BooleanProperty", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getBooleanProperty_Value(), ecorePackage.getEBoolean(), "value", "false", 1, 1,
|
||||
BooleanProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(referencePropertyEClass, ReferenceProperty.class, "ReferenceProperty", !IS_ABSTRACT, !IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getReferenceProperty_Ref(), this.getPropertyHolder(), null, "ref", null, 1, 1,
|
||||
ReferenceProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
|
||||
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(propertyHolderEClass, PropertyHolder.class, "PropertyHolder", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getPropertyHolder_Properties(), this.getProperty(), null, "properties", null, 0, -1,
|
||||
PropertyHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
|
||||
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(namedElementEClass, NamedElement.class, "NamedElement", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getNamedElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, NamedElement.class,
|
||||
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getIdentifiedElement_Uid(), ecorePackage.getEString(), "uid", null, 0, 1,
|
||||
IdentifiedElement.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_UNSETTABLE, IS_ID, IS_UNIQUE,
|
||||
!IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getModel_ModelElements(), this.getGraphElement(), null, "modelElements", null, 0, -1,
|
||||
Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
|
||||
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(borderElementEClass, BorderElement.class, "BorderElement", IS_ABSTRACT, IS_INTERFACE,
|
||||
IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(elementEClass, Element.class, "Element", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
// Initialize enums and add enum literals
|
||||
initEEnum(portDirectionEEnum, PortDirection.class, "PortDirection");
|
||||
addEEnumLiteral(portDirectionEEnum, PortDirection.UNSPECIFIED);
|
||||
addEEnumLiteral(portDirectionEEnum, PortDirection.IN);
|
||||
addEEnumLiteral(portDirectionEEnum, PortDirection.OUT);
|
||||
addEEnumLiteral(portDirectionEEnum, PortDirection.INOUT);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
|
||||
// Create annotations
|
||||
// http://www.eclipse.org/OCL/Import
|
||||
createImportAnnotations();
|
||||
// http://www.eclipse.org/emf/2002/Ecore
|
||||
createEcoreAnnotations();
|
||||
// http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot
|
||||
createPivotAnnotations();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/OCL/Import</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createImportAnnotations() {
|
||||
String source = "http://www.eclipse.org/OCL/Import";
|
||||
addAnnotation(this, source, new String[] { "ecore", "http://www.eclipse.org/emf/2002/Ecore" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createEcoreAnnotations() {
|
||||
String source = "http://www.eclipse.org/emf/2002/Ecore";
|
||||
addAnnotation(this, source,
|
||||
new String[] { "invocationDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot",
|
||||
"settingDelegates", "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "validationDelegates",
|
||||
"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot" });
|
||||
addAnnotation(propertyEClass, source, new String[] { "constraints", "keyNotNull" });
|
||||
addAnnotation(propertyHolderEClass, source, new String[] { "constraints", "uniqueKeys" });
|
||||
addAnnotation(namedElementEClass, source, new String[] { "constraints", "nameNotEmpty" });
|
||||
addAnnotation(identifiedElementEClass, source, new String[] { "constraints", "uidNotEmpty" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</b>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected void createPivotAnnotations() {
|
||||
String source = "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot";
|
||||
addAnnotation(propertyEClass, source, new String[] { "keyNotNull", "key <> \'\'" });
|
||||
addAnnotation(propertyHolderEClass, source,
|
||||
new String[] { "uniqueKeys", "properties->forAll(p1, p2 | p1 <> p2 implies p1.key <> p2.key)" });
|
||||
addAnnotation(namedElementEClass, source, new String[] { "nameNotEmpty", "name <> \'\'" });
|
||||
addAnnotation(identifiedElementEClass, source, new String[] { "uidNotEmpty", "uid <> \'\'" });
|
||||
}
|
||||
|
||||
} //SeimPackageImpl
|
||||
@@ -0,0 +1,288 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
|
||||
* 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
|
||||
* https://www.eclipse.org/legal/epl-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
|
||||
* Pierre Virelizier (IRT Saint Exupéry)
|
||||
* Julien Baclet (IRT Saint Exupéry)
|
||||
* Pierre Gaufillet (IRT Saint Exupéry)
|
||||
*******************************************************************************/
|
||||
/**
|
||||
*/
|
||||
package com.irtsaintexupery.pseim.seim.impl;
|
||||
|
||||
import com.irtsaintexupery.pseim.seim.SeimPackage;
|
||||
import com.irtsaintexupery.pseim.seim.StringProperty;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>String Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.StringPropertyImpl#getUid <em>Uid</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.StringPropertyImpl#getKey <em>Key</em>}</li>
|
||||
* <li>{@link com.irtsaintexupery.pseim.seim.impl.StringPropertyImpl#getValue <em>Value</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class StringPropertyImpl extends MinimalEObjectImpl.Container implements StringProperty {
|
||||
/**
|
||||
* The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String UID_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getUid()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String uid = UID_EDEFAULT;
|
||||
|
||||
/**
|
||||
* This is true if the Uid attribute has been set.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean uidESet;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String KEY_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getKey()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String key = KEY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String VALUE_EDEFAULT = "\'\'";
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getValue()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String value = VALUE_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected StringPropertyImpl() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass() {
|
||||
return SeimPackage.Literals.STRING_PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isSetUid() {
|
||||
return uidESet;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setKey(String newKey) {
|
||||
String oldKey = key;
|
||||
key = newKey;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.STRING_PROPERTY__KEY, oldKey, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setValue(String newValue) {
|
||||
String oldValue = value;
|
||||
value = newValue;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, SeimPackage.STRING_PROPERTY__VALUE, oldValue, value));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.STRING_PROPERTY__UID:
|
||||
return getUid();
|
||||
case SeimPackage.STRING_PROPERTY__KEY:
|
||||
return getKey();
|
||||
case SeimPackage.STRING_PROPERTY__VALUE:
|
||||
return getValue();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.STRING_PROPERTY__KEY:
|
||||
setKey((String) newValue);
|
||||
return;
|
||||
case SeimPackage.STRING_PROPERTY__VALUE:
|
||||
setValue((String) newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.STRING_PROPERTY__KEY:
|
||||
setKey(KEY_EDEFAULT);
|
||||
return;
|
||||
case SeimPackage.STRING_PROPERTY__VALUE:
|
||||
setValue(VALUE_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID) {
|
||||
switch (featureID) {
|
||||
case SeimPackage.STRING_PROPERTY__UID:
|
||||
return isSetUid();
|
||||
case SeimPackage.STRING_PROPERTY__KEY:
|
||||
return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
|
||||
case SeimPackage.STRING_PROPERTY__VALUE:
|
||||
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (eIsProxy())
|
||||
return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (uid: ");
|
||||
if (uidESet)
|
||||
result.append(uid);
|
||||
else
|
||||
result.append("<unset>");
|
||||
result.append(", key: ");
|
||||
result.append(key);
|
||||
result.append(", value: ");
|
||||
result.append(value);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //StringPropertyImpl
|
||||
Reference in New Issue
Block a user