Browse Source

Added DocumentedElement to Base.Ecore

Andreas Mülder 12 years ago
parent
commit
8a487c4eb9

+ 5 - 4
plugins/org.yakindu.base.types/model/base.ecore

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="base"
-    nsURI="http://www.yakindu.org/base/base/2.0.0" nsPrefix="base">
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="base" nsURI="http://www.yakindu.org/base/base/2.0.0" nsPrefix="base">
   <eClassifiers xsi:type="ecore:EClass" name="NamedElement">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
   </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="DocumentedElement">
+    <eStructuralFeatures xsi:type="ecore:EAttribute" name="documentation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+  </eClassifiers>
 </ecore:EPackage>

+ 9 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/BaseFactory.java

@@ -34,6 +34,15 @@ public interface BaseFactory extends EFactory {
 	 */
 	NamedElement createNamedElement();
 
+	/**
+	 * Returns a new object of class '<em>Documented Element</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Documented Element</em>'.
+	 * @generated
+	 */
+	DocumentedElement createDocumentedElement();
+
 	/**
 	 * Returns the package supported by this factory.
 	 * <!-- begin-user-doc -->

+ 68 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/BasePackage.java

@@ -87,6 +87,35 @@ public interface BasePackage extends EPackage {
 	int NAMED_ELEMENT_FEATURE_COUNT = 1;
 
 
+	/**
+	 * The meta object id for the '{@link org.yakindu.base.base.impl.DocumentedElementImpl <em>Documented Element</em>}' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see org.yakindu.base.base.impl.DocumentedElementImpl
+	 * @see org.yakindu.base.base.impl.BasePackageImpl#getDocumentedElement()
+	 * @generated
+	 */
+	int DOCUMENTED_ELEMENT = 1;
+
+	/**
+	 * The feature id for the '<em><b>Documentation</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int DOCUMENTED_ELEMENT__DOCUMENTATION = 0;
+
+	/**
+	 * The number of structural features of the '<em>Documented Element</em>' class.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 * @ordered
+	 */
+	int DOCUMENTED_ELEMENT_FEATURE_COUNT = 1;
+
+
 	/**
 	 * Returns the meta object for class '{@link org.yakindu.base.base.NamedElement <em>Named Element</em>}'.
 	 * <!-- begin-user-doc -->
@@ -108,6 +137,27 @@ public interface BasePackage extends EPackage {
 	 */
 	EAttribute getNamedElement_Name();
 
+	/**
+	 * Returns the meta object for class '{@link org.yakindu.base.base.DocumentedElement <em>Documented Element</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for class '<em>Documented Element</em>'.
+	 * @see org.yakindu.base.base.DocumentedElement
+	 * @generated
+	 */
+	EClass getDocumentedElement();
+
+	/**
+	 * Returns the meta object for the attribute '{@link org.yakindu.base.base.DocumentedElement#getDocumentation <em>Documentation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return the meta object for the attribute '<em>Documentation</em>'.
+	 * @see org.yakindu.base.base.DocumentedElement#getDocumentation()
+	 * @see #getDocumentedElement()
+	 * @generated
+	 */
+	EAttribute getDocumentedElement_Documentation();
+
 	/**
 	 * Returns the factory that creates the instances of the model.
 	 * <!-- begin-user-doc -->
@@ -148,6 +198,24 @@ public interface BasePackage extends EPackage {
 		 */
 		EAttribute NAMED_ELEMENT__NAME = eINSTANCE.getNamedElement_Name();
 
+		/**
+		 * The meta object literal for the '{@link org.yakindu.base.base.impl.DocumentedElementImpl <em>Documented Element</em>}' class.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @see org.yakindu.base.base.impl.DocumentedElementImpl
+		 * @see org.yakindu.base.base.impl.BasePackageImpl#getDocumentedElement()
+		 * @generated
+		 */
+		EClass DOCUMENTED_ELEMENT = eINSTANCE.getDocumentedElement();
+
+		/**
+		 * The meta object literal for the '<em><b>Documentation</b></em>' attribute feature.
+		 * <!-- begin-user-doc -->
+		 * <!-- end-user-doc -->
+		 * @generated
+		 */
+		EAttribute DOCUMENTED_ELEMENT__DOCUMENTATION = eINSTANCE.getDocumentedElement_Documentation();
+
 	}
 
 } //BasePackage

+ 50 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/DocumentedElement.java

@@ -0,0 +1,50 @@
+/**
+ */
+package org.yakindu.base.base;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Documented Element</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.yakindu.base.base.DocumentedElement#getDocumentation <em>Documentation</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.yakindu.base.base.BasePackage#getDocumentedElement()
+ * @model
+ * @generated
+ */
+public interface DocumentedElement extends EObject {
+	/**
+	 * Returns the value of the '<em><b>Documentation</b></em>' attribute.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Documentation</em>' attribute isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Documentation</em>' attribute.
+	 * @see #setDocumentation(String)
+	 * @see org.yakindu.base.base.BasePackage#getDocumentedElement_Documentation()
+	 * @model
+	 * @generated
+	 */
+	String getDocumentation();
+
+	/**
+	 * Sets the value of the '{@link org.yakindu.base.base.DocumentedElement#getDocumentation <em>Documentation</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Documentation</em>' attribute.
+	 * @see #getDocumentation()
+	 * @generated
+	 */
+	void setDocumentation(String value);
+
+} // DocumentedElement

+ 11 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/impl/BaseFactoryImpl.java

@@ -61,6 +61,7 @@ public class BaseFactoryImpl extends EFactoryImpl implements BaseFactory {
 	public EObject create(EClass eClass) {
 		switch (eClass.getClassifierID()) {
 			case BasePackage.NAMED_ELEMENT: return createNamedElement();
+			case BasePackage.DOCUMENTED_ELEMENT: return createDocumentedElement();
 			default:
 				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
 		}
@@ -76,6 +77,16 @@ public class BaseFactoryImpl extends EFactoryImpl implements BaseFactory {
 		return namedElement;
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public DocumentedElement createDocumentedElement() {
+		DocumentedElementImpl documentedElement = new DocumentedElementImpl();
+		return documentedElement;
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 32 - 8
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/impl/BasePackageImpl.java

@@ -6,20 +6,13 @@
  */
 package org.yakindu.base.base.impl;
 
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
 import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
 import org.eclipse.emf.ecore.EPackage;
 import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
 import org.yakindu.base.base.BaseFactory;
 import org.yakindu.base.base.BasePackage;
+import org.yakindu.base.base.DocumentedElement;
 import org.yakindu.base.base.NamedElement;
 
 /**
@@ -36,6 +29,13 @@ public class BasePackageImpl extends EPackageImpl implements BasePackage {
 	 */
 	private EClass namedElementEClass = null;
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass documentedElementEClass = null;
+
 	/**
 	 * Creates an instance of the model <b>Package</b>, registered with
 	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
@@ -115,6 +115,24 @@ public class BasePackageImpl extends EPackageImpl implements BasePackage {
 		return (EAttribute)namedElementEClass.getEStructuralFeatures().get(0);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getDocumentedElement() {
+		return documentedElementEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getDocumentedElement_Documentation() {
+		return (EAttribute)documentedElementEClass.getEStructuralFeatures().get(0);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -145,6 +163,9 @@ public class BasePackageImpl extends EPackageImpl implements BasePackage {
 		// Create classes and their features
 		namedElementEClass = createEClass(NAMED_ELEMENT);
 		createEAttribute(namedElementEClass, NAMED_ELEMENT__NAME);
+
+		documentedElementEClass = createEClass(DOCUMENTED_ELEMENT);
+		createEAttribute(documentedElementEClass, DOCUMENTED_ELEMENT__DOCUMENTATION);
 	}
 
 	/**
@@ -180,6 +201,9 @@ public class BasePackageImpl extends EPackageImpl implements BasePackage {
 		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(documentedElementEClass, DocumentedElement.class, "DocumentedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEAttribute(getDocumentedElement_Documentation(), ecorePackage.getEString(), "documentation", null, 0, 1, DocumentedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
 		// Create resource
 		createResource(eNS_URI);
 	}

+ 163 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/impl/DocumentedElementImpl.java

@@ -0,0 +1,163 @@
+/**
+ */
+package org.yakindu.base.base.impl;
+
+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.EObjectImpl;
+
+import org.yakindu.base.base.BasePackage;
+import org.yakindu.base.base.DocumentedElement;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Documented Element</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ *   <li>{@link org.yakindu.base.base.impl.DocumentedElementImpl#getDocumentation <em>Documentation</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class DocumentedElementImpl extends EObjectImpl implements DocumentedElement {
+	/**
+	 * The default value of the '{@link #getDocumentation() <em>Documentation</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getDocumentation()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final String DOCUMENTATION_EDEFAULT = null;
+
+	/**
+	 * The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getDocumentation()
+	 * @generated
+	 * @ordered
+	 */
+	protected String documentation = DOCUMENTATION_EDEFAULT;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected DocumentedElementImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return BasePackage.Literals.DOCUMENTED_ELEMENT;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getDocumentation() {
+		return documentation;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setDocumentation(String newDocumentation) {
+		String oldDocumentation = documentation;
+		documentation = newDocumentation;
+		if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION, oldDocumentation, documentation));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION:
+				return getDocumentation();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION:
+				setDocumentation((String)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION:
+				setDocumentation(DOCUMENTATION_EDEFAULT);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case BasePackage.DOCUMENTED_ELEMENT__DOCUMENTATION:
+				return DOCUMENTATION_EDEFAULT == null ? documentation != null : !DOCUMENTATION_EDEFAULT.equals(documentation);
+		}
+		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(" (documentation: ");
+		result.append(documentation);
+		result.append(')');
+		return result.toString();
+	}
+
+} //DocumentedElementImpl

+ 18 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/util/BaseAdapterFactory.java

@@ -76,6 +76,10 @@ public class BaseAdapterFactory extends AdapterFactoryImpl {
 				return createNamedElementAdapter();
 			}
 			@Override
+			public Adapter caseDocumentedElement(DocumentedElement object) {
+				return createDocumentedElementAdapter();
+			}
+			@Override
 			public Adapter defaultCase(EObject object) {
 				return createEObjectAdapter();
 			}
@@ -109,6 +113,20 @@ public class BaseAdapterFactory extends AdapterFactoryImpl {
 		return null;
 	}
 
+	/**
+	 * Creates a new adapter for an object of class '{@link org.yakindu.base.base.DocumentedElement <em>Documented Element</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see org.yakindu.base.base.DocumentedElement
+	 * @generated
+	 */
+	public Adapter createDocumentedElementAdapter() {
+		return null;
+	}
+
 	/**
 	 * Creates a new adapter for the default case.
 	 * <!-- begin-user-doc -->

+ 21 - 0
plugins/org.yakindu.base.types/src-gen/org/yakindu/base/base/util/BaseSwitch.java

@@ -76,6 +76,12 @@ public class BaseSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
+			case BasePackage.DOCUMENTED_ELEMENT: {
+				DocumentedElement documentedElement = (DocumentedElement)theEObject;
+				T result = caseDocumentedElement(documentedElement);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
 			default: return defaultCase(theEObject);
 		}
 	}
@@ -95,6 +101,21 @@ public class BaseSwitch<T> extends Switch<T> {
 		return null;
 	}
 
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Documented Element</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Documented Element</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseDocumentedElement(DocumentedElement object) {
+		return null;
+	}
+
 	/**
 	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
 	 * <!-- begin-user-doc -->