Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/InheritanceImpl.java')
-rwxr-xr-xcore/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/InheritanceImpl.java165
1 files changed, 165 insertions, 0 deletions
diff --git a/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/InheritanceImpl.java b/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/InheritanceImpl.java
new file mode 100755
index 000000000..bd19f2fdb
--- /dev/null
+++ b/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/InheritanceImpl.java
@@ -0,0 +1,165 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: InheritanceImpl.java,v 1.7 2007/11/14 16:37:54 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.annotations.pannotation.impl;
+
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.teneo.annotations.pannotation.Inheritance;
+import org.eclipse.emf.teneo.annotations.pannotation.InheritanceType;
+import org.eclipse.emf.teneo.annotations.pannotation.PannotationPackage;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Inheritance</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.teneo.annotations.pannotation.impl.InheritanceImpl#getStrategy <em>Strategy</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class InheritanceImpl extends PAnnotationImpl implements Inheritance {
+ /**
+ * The default value of the '{@link #getStrategy() <em>Strategy</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getStrategy()
+ * @generated
+ * @ordered
+ */
+ protected static final InheritanceType STRATEGY_EDEFAULT = InheritanceType.SINGLE_TABLE;
+
+ /**
+ * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getStrategy()
+ * @generated
+ * @ordered
+ */
+ protected InheritanceType strategy = STRATEGY_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ protected InheritanceImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PannotationPackage.Literals.INHERITANCE;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public InheritanceType getStrategy() {
+ return strategy;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStrategy(InheritanceType newStrategy) {
+ InheritanceType oldStrategy = strategy;
+ strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PannotationPackage.INHERITANCE__STRATEGY, oldStrategy, strategy));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PannotationPackage.INHERITANCE__STRATEGY:
+ return getStrategy();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PannotationPackage.INHERITANCE__STRATEGY:
+ setStrategy((InheritanceType)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PannotationPackage.INHERITANCE__STRATEGY:
+ setStrategy(STRATEGY_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PannotationPackage.INHERITANCE__STRATEGY:
+ return strategy != STRATEGY_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(" (strategy: ");
+ result.append(strategy);
+ result.append(')');
+ return result.toString();
+ }
+
+ @Override
+ public String getJavaAnnotation(List<String> imports) {
+ if (getStrategy() == InheritanceType.SINGLE_TABLE) {
+ // the default don't display this
+ return "";
+ }
+ return super.getJavaAnnotation(imports);
+ }
+
+} // InheritanceImpl

Back to the top