|
@@ -6,15 +6,20 @@
|
|
|
*/
|
|
|
package org.yakindu.base.types.impl;
|
|
|
|
|
|
+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.EObjectImpl;
|
|
|
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
|
|
import org.eclipse.emf.ecore.util.EcoreUtil;
|
|
|
import org.yakindu.base.base.BasePackage;
|
|
|
import org.yakindu.base.base.NamedElement;
|
|
|
+import org.yakindu.base.types.AnnotatableElement;
|
|
|
+import org.yakindu.base.types.Annotation;
|
|
|
import org.yakindu.base.types.Operation;
|
|
|
import org.yakindu.base.types.Parameter;
|
|
|
import org.yakindu.base.types.Type;
|
|
@@ -32,6 +37,7 @@ import org.yakindu.base.types.TypesPackage;
|
|
|
* <li>{@link org.yakindu.base.types.impl.ParameterImpl#getType <em>Type</em>}</li>
|
|
|
* <li>{@link org.yakindu.base.types.impl.ParameterImpl#getTypeSpecifier <em>Type Specifier</em>}</li>
|
|
|
* <li>{@link org.yakindu.base.types.impl.ParameterImpl#getName <em>Name</em>}</li>
|
|
|
+ * <li>{@link org.yakindu.base.types.impl.ParameterImpl#getAnnotations <em>Annotations</em>}</li>
|
|
|
* <li>{@link org.yakindu.base.types.impl.ParameterImpl#getOwningOperation <em>Owning Operation</em>}</li>
|
|
|
* </ul>
|
|
|
*
|
|
@@ -68,6 +74,16 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
*/
|
|
|
protected String name = NAME_EDEFAULT;
|
|
|
|
|
|
+ /**
|
|
|
+ * The cached value of the '{@link #getAnnotations() <em>Annotations</em>}' reference list.
|
|
|
+ * <!-- begin-user-doc -->
|
|
|
+ * <!-- end-user-doc -->
|
|
|
+ * @see #getAnnotations()
|
|
|
+ * @generated
|
|
|
+ * @ordered
|
|
|
+ */
|
|
|
+ protected EList<Annotation> annotations;
|
|
|
+
|
|
|
/**
|
|
|
* <!-- begin-user-doc -->
|
|
|
* <!-- end-user-doc -->
|
|
@@ -173,6 +189,18 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
eNotify(new ENotificationImpl(this, Notification.SET, TypesPackage.PARAMETER__NAME, oldName, name));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * <!-- begin-user-doc -->
|
|
|
+ * <!-- end-user-doc -->
|
|
|
+ * @generated
|
|
|
+ */
|
|
|
+ public EList<Annotation> getAnnotations() {
|
|
|
+ if (annotations == null) {
|
|
|
+ annotations = new EObjectResolvingEList<Annotation>(Annotation.class, this, TypesPackage.PARAMETER__ANNOTATIONS);
|
|
|
+ }
|
|
|
+ return annotations;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* <!-- begin-user-doc -->
|
|
|
* <!-- end-user-doc -->
|
|
@@ -275,6 +303,8 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
return getTypeSpecifier();
|
|
|
case TypesPackage.PARAMETER__NAME:
|
|
|
return getName();
|
|
|
+ case TypesPackage.PARAMETER__ANNOTATIONS:
|
|
|
+ return getAnnotations();
|
|
|
case TypesPackage.PARAMETER__OWNING_OPERATION:
|
|
|
return getOwningOperation();
|
|
|
}
|
|
@@ -286,6 +316,7 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
* <!-- end-user-doc -->
|
|
|
* @generated
|
|
|
*/
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public void eSet(int featureID, Object newValue) {
|
|
|
switch (featureID) {
|
|
@@ -295,6 +326,10 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
case TypesPackage.PARAMETER__NAME:
|
|
|
setName((String)newValue);
|
|
|
return;
|
|
|
+ case TypesPackage.PARAMETER__ANNOTATIONS:
|
|
|
+ getAnnotations().clear();
|
|
|
+ getAnnotations().addAll((Collection<? extends Annotation>)newValue);
|
|
|
+ return;
|
|
|
case TypesPackage.PARAMETER__OWNING_OPERATION:
|
|
|
setOwningOperation((Operation)newValue);
|
|
|
return;
|
|
@@ -316,6 +351,9 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
case TypesPackage.PARAMETER__NAME:
|
|
|
setName(NAME_EDEFAULT);
|
|
|
return;
|
|
|
+ case TypesPackage.PARAMETER__ANNOTATIONS:
|
|
|
+ getAnnotations().clear();
|
|
|
+ return;
|
|
|
case TypesPackage.PARAMETER__OWNING_OPERATION:
|
|
|
setOwningOperation((Operation)null);
|
|
|
return;
|
|
@@ -337,6 +375,8 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
return typeSpecifier != null;
|
|
|
case TypesPackage.PARAMETER__NAME:
|
|
|
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
|
|
+ case TypesPackage.PARAMETER__ANNOTATIONS:
|
|
|
+ return annotations != null && !annotations.isEmpty();
|
|
|
case TypesPackage.PARAMETER__OWNING_OPERATION:
|
|
|
return getOwningOperation() != null;
|
|
|
}
|
|
@@ -356,6 +396,12 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
default: return -1;
|
|
|
}
|
|
|
}
|
|
|
+ if (baseClass == AnnotatableElement.class) {
|
|
|
+ switch (derivedFeatureID) {
|
|
|
+ case TypesPackage.PARAMETER__ANNOTATIONS: return TypesPackage.ANNOTATABLE_ELEMENT__ANNOTATIONS;
|
|
|
+ default: return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
|
|
|
}
|
|
|
|
|
@@ -372,6 +418,12 @@ public class ParameterImpl extends EObjectImpl implements Parameter {
|
|
|
default: return -1;
|
|
|
}
|
|
|
}
|
|
|
+ if (baseClass == AnnotatableElement.class) {
|
|
|
+ switch (baseFeatureID) {
|
|
|
+ case TypesPackage.ANNOTATABLE_ELEMENT__ANNOTATIONS: return TypesPackage.PARAMETER__ANNOTATIONS;
|
|
|
+ default: return -1;
|
|
|
+ }
|
|
|
+ }
|
|
|
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
|
|
|
}
|
|
|
|