diff options
author | mtaal | 2009-08-21 15:01:54 +0000 |
---|---|---|
committer | mtaal | 2009-08-21 15:01:54 +0000 |
commit | 4276e0b66d04c30b553b5282a535bbf15e6b3101 (patch) | |
tree | 875004c775198ae1ae0b1457431c95afc6c963b5 /examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf | |
parent | d20ababeee0b758790dba9ef35d7c5fbd4601479 (diff) | |
download | org.eclipse.emf.teneo-4276e0b66d04c30b553b5282a535bbf15e6b3101.tar.gz org.eclipse.emf.teneo-4276e0b66d04c30b553b5282a535bbf15e6b3101.tar.xz org.eclipse.emf.teneo-4276e0b66d04c30b553b5282a535bbf15e6b3101.zip |
Support for EAV Schema and Mapping
Diffstat (limited to 'examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf')
22 files changed, 4164 insertions, 0 deletions
diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Book.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Book.java new file mode 100644 index 000000000..108175c79 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Book.java @@ -0,0 +1,254 @@ +/** + * <copyright> + * </copyright> + * + * $Id: Book.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Book</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTitle <em>Title</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages <em>Pages</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory <em>Category</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor <em>Author</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest <em>Test</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook() + * @model extendedMetaData="name='Book' kind='elementOnly'" + * @generated + */ +public interface Book extends EObject { + /** + * Returns the value of the '<em><b>Title</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Title</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Title</em>' attribute. + * @see #setTitle(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook_Title() + * @model id="true" dataType="org.eclipse.emf.ecore.xml.type.ID" required="true" + * extendedMetaData="kind='element' name='title'" + * @generated + */ + String getTitle(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTitle <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Title</em>' attribute. + * @see #getTitle() + * @generated + */ + void setTitle(String value); + + /** + * Returns the value of the '<em><b>Pages</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Pages</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Pages</em>' attribute. + * @see #isSetPages() + * @see #unsetPages() + * @see #setPages(int) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook_Pages() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Int" required="true" + * extendedMetaData="kind='element' name='pages'" + * @generated + */ + int getPages(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages <em>Pages</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Pages</em>' attribute. + * @see #isSetPages() + * @see #unsetPages() + * @see #getPages() + * @generated + */ + void setPages(int value); + + /** + * Unsets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages <em>Pages</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetPages() + * @see #getPages() + * @see #setPages(int) + * @generated + */ + void unsetPages(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages <em>Pages</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Pages</em>' attribute is set. + * @see #unsetPages() + * @see #getPages() + * @see #setPages(int) + * @generated + */ + boolean isSetPages(); + + /** + * Returns the value of the '<em><b>Category</b></em>' attribute. + * The literals are from the enumeration {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Category</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Category</em>' attribute. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see #isSetCategory() + * @see #unsetCategory() + * @see #setCategory(BookCategory) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook_Category() + * @model unsettable="true" required="true" + * annotation="teneo.jpa appinfo='@Enumerated(ORDINAL)'" + * extendedMetaData="kind='element' name='category'" + * @generated + */ + BookCategory getCategory(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory <em>Category</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Category</em>' attribute. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see #isSetCategory() + * @see #unsetCategory() + * @see #getCategory() + * @generated + */ + void setCategory(BookCategory value); + + /** + * Unsets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory <em>Category</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetCategory() + * @see #getCategory() + * @see #setCategory(BookCategory) + * @generated + */ + void unsetCategory(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory <em>Category</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Category</em>' attribute is set. + * @see #unsetCategory() + * @see #getCategory() + * @see #setCategory(BookCategory) + * @generated + */ + boolean isSetCategory(); + + /** + * Returns the value of the '<em><b>Author</b></em>' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getBooks <em>Books</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Author</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Author</em>' reference. + * @see #setAuthor(Writer) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook_Author() + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getBooks + * @model opposite="books" required="true" + * extendedMetaData="kind='element' name='author'" + * @generated + */ + Writer getAuthor(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor <em>Author</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Author</em>' reference. + * @see #getAuthor() + * @generated + */ + void setAuthor(Writer value); + + /** + * Returns the value of the '<em><b>Test</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Test</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Test</em>' attribute. + * @see #isSetTest() + * @see #unsetTest() + * @see #setTest(int) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBook_Test() + * @model unsettable="true" dataType="org.eclipse.emf.ecore.xml.type.Int" + * extendedMetaData="kind='attribute' name='test'" + * @generated + */ + int getTest(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest <em>Test</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Test</em>' attribute. + * @see #isSetTest() + * @see #unsetTest() + * @see #getTest() + * @generated + */ + void setTest(int value); + + /** + * Unsets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest <em>Test</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isSetTest() + * @see #getTest() + * @see #setTest(int) + * @generated + */ + void unsetTest(); + + /** + * Returns whether the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest <em>Test</em>}' attribute is set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return whether the value of the '<em>Test</em>' attribute is set. + * @see #unsetTest() + * @see #getTest() + * @see #setTest(int) + * @generated + */ + boolean isSetTest(); + +} // Book diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/BookCategory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/BookCategory.java new file mode 100644 index 000000000..9bfbec132 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/BookCategory.java @@ -0,0 +1,239 @@ +/** + * <copyright> + * </copyright> + * + * $Id: BookCategory.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * <!-- begin-user-doc --> + * A representation of the literals of the enumeration '<em><b>Book Category</b></em>', + * and utility methods for working with them. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getBookCategory() + * @model extendedMetaData="name='BookCategory'" + * @generated + */ +public enum BookCategory implements Enumerator { + /** + * The '<em><b>Mystery</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #MYSTERY_VALUE + * @generated + * @ordered + */ + MYSTERY(0, "Mystery", "Mystery"), + + /** + * The '<em><b>Science Fiction</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #SCIENCE_FICTION_VALUE + * @generated + * @ordered + */ + SCIENCE_FICTION(1, "ScienceFiction", "ScienceFiction"), + + /** + * The '<em><b>Biography</b></em>' literal object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #BIOGRAPHY_VALUE + * @generated + * @ordered + */ + BIOGRAPHY(2, "Biography", "Biography"); + + /** + * The '<em><b>Mystery</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>Mystery</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #MYSTERY + * @model name="Mystery" + * @generated + * @ordered + */ + public static final int MYSTERY_VALUE = 0; + + /** + * The '<em><b>Science Fiction</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>Science Fiction</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #SCIENCE_FICTION + * @model name="ScienceFiction" + * @generated + * @ordered + */ + public static final int SCIENCE_FICTION_VALUE = 1; + + /** + * The '<em><b>Biography</b></em>' literal value. + * <!-- begin-user-doc --> + * <p> + * If the meaning of '<em><b>Biography</b></em>' literal object isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @see #BIOGRAPHY + * @model name="Biography" + * @generated + * @ordered + */ + public static final int BIOGRAPHY_VALUE = 2; + + /** + * An array of all the '<em><b>Book Category</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static final BookCategory[] VALUES_ARRAY = + new BookCategory[] { + MYSTERY, + SCIENCE_FICTION, + BIOGRAPHY, + }; + + /** + * A public read-only list of all the '<em><b>Book Category</b></em>' enumerators. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final List<BookCategory> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the '<em><b>Book Category</b></em>' literal with the specified literal value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static BookCategory get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + BookCategory result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Book Category</b></em>' literal with the specified name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static BookCategory getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + BookCategory result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the '<em><b>Book Category</b></em>' literal with the specified integer value. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static BookCategory get(int value) { + switch (value) { + case MYSTERY_VALUE: return MYSTERY; + case SCIENCE_FICTION_VALUE: return SCIENCE_FICTION; + case BIOGRAPHY_VALUE: return BIOGRAPHY; + } + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final int value; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String name; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private BookCategory(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getValue() { + return value; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getName() { + return name; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //BookCategory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/City.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/City.java new file mode 100644 index 000000000..7ee076641 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/City.java @@ -0,0 +1,55 @@ +/** + * <copyright> + * </copyright> + * + * $Id: City.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>City</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getCity() + * @model extendedMetaData="name='City' kind='elementOnly'" + * @generated + */ +public interface City extends EObject { + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getCity_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='element' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + +} // City diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryFactory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryFactory.java new file mode 100644 index 000000000..6366286ac --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryFactory.java @@ -0,0 +1,73 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryFactory.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage + * @generated + */ +public interface EavlibraryFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EavlibraryFactory eINSTANCE = org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Book</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Book</em>'. + * @generated + */ + Book createBook(); + + /** + * Returns a new object of class '<em>City</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>City</em>'. + * @generated + */ + City createCity(); + + /** + * Returns a new object of class '<em>Library</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Library</em>'. + * @generated + */ + Library createLibrary(); + + /** + * Returns a new object of class '<em>Writer</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Writer</em>'. + * @generated + */ + Writer createWriter(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + EavlibraryPackage getEavlibraryPackage(); + +} //EavlibraryFactory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryPackage.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryPackage.java new file mode 100644 index 000000000..1b2f9e410 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/EavlibraryPackage.java @@ -0,0 +1,643 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryPackage.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryFactory + * @model kind="package" + * @generated + */ +public interface EavlibraryPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "eavlibrary"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/emf/teneo/samples/emf/annotations/eavlibrary"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "eavlibrary"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EavlibraryPackage eINSTANCE = org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl <em>Book</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBook() + * @generated + */ + int BOOK = 0; + + /** + * The feature id for the '<em><b>Title</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK__TITLE = 0; + + /** + * The feature id for the '<em><b>Pages</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK__PAGES = 1; + + /** + * The feature id for the '<em><b>Category</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK__CATEGORY = 2; + + /** + * The feature id for the '<em><b>Author</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK__AUTHOR = 3; + + /** + * The feature id for the '<em><b>Test</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK__TEST = 4; + + /** + * The number of structural features of the '<em>Book</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOOK_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.CityImpl <em>City</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.CityImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getCity() + * @generated + */ + int CITY = 1; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CITY__NAME = 0; + + /** + * The number of structural features of the '<em>City</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int CITY_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl <em>Library</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getLibrary() + * @generated + */ + int LIBRARY = 2; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int LIBRARY__NAME = 0; + + /** + * The feature id for the '<em><b>Writers</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int LIBRARY__WRITERS = 1; + + /** + * The feature id for the '<em><b>Books</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int LIBRARY__BOOKS = 2; + + /** + * The number of structural features of the '<em>Library</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int LIBRARY_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl <em>Writer</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getWriter() + * @generated + */ + int WRITER = 3; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int WRITER__NAME = 0; + + /** + * The feature id for the '<em><b>Books</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int WRITER__BOOKS = 1; + + /** + * The feature id for the '<em><b>City</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int WRITER__CITY = 2; + + /** + * The number of structural features of the '<em>Writer</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int WRITER_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory <em>Book Category</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBookCategory() + * @generated + */ + int BOOK_CATEGORY = 4; + + /** + * The meta object id for the '<em>Book Category Object</em>' data type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBookCategoryObject() + * @generated + */ + int BOOK_CATEGORY_OBJECT = 5; + + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book <em>Book</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Book</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book + * @generated + */ + EClass getBook(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTitle <em>Title</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Title</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTitle() + * @see #getBook() + * @generated + */ + EAttribute getBook_Title(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages <em>Pages</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Pages</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getPages() + * @see #getBook() + * @generated + */ + EAttribute getBook_Pages(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory <em>Category</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Category</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getCategory() + * @see #getBook() + * @generated + */ + EAttribute getBook_Category(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor <em>Author</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Author</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor() + * @see #getBook() + * @generated + */ + EReference getBook_Author(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest <em>Test</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Test</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getTest() + * @see #getBook() + * @generated + */ + EAttribute getBook_Test(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City <em>City</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>City</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City + * @generated + */ + EClass getCity(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City#getName() + * @see #getCity() + * @generated + */ + EAttribute getCity_Name(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library <em>Library</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Library</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library + * @generated + */ + EClass getLibrary(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getName() + * @see #getLibrary() + * @generated + */ + EAttribute getLibrary_Name(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getWriters <em>Writers</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Writers</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getWriters() + * @see #getLibrary() + * @generated + */ + EReference getLibrary_Writers(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getBooks <em>Books</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Books</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getBooks() + * @see #getLibrary() + * @generated + */ + EReference getLibrary_Books(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer <em>Writer</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Writer</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer + * @generated + */ + EClass getWriter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getName <em>Name</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Name</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getName() + * @see #getWriter() + * @generated + */ + EAttribute getWriter_Name(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getBooks <em>Books</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Books</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getBooks() + * @see #getWriter() + * @generated + */ + EReference getWriter_Books(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getCity <em>City</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>City</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getCity() + * @see #getWriter() + * @generated + */ + EReference getWriter_City(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory <em>Book Category</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for enum '<em>Book Category</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @generated + */ + EEnum getBookCategory(); + + /** + * Returns the meta object for data type '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory <em>Book Category Object</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for data type '<em>Book Category Object</em>'. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @model instanceClass="org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory" + * extendedMetaData="name='BookCategory:Object' baseType='BookCategory'" + * @generated + */ + EDataType getBookCategoryObject(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + EavlibraryFactory getEavlibraryFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl <em>Book</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBook() + * @generated + */ + EClass BOOK = eINSTANCE.getBook(); + + /** + * The meta object literal for the '<em><b>Title</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute BOOK__TITLE = eINSTANCE.getBook_Title(); + + /** + * The meta object literal for the '<em><b>Pages</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute BOOK__PAGES = eINSTANCE.getBook_Pages(); + + /** + * The meta object literal for the '<em><b>Category</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute BOOK__CATEGORY = eINSTANCE.getBook_Category(); + + /** + * The meta object literal for the '<em><b>Author</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference BOOK__AUTHOR = eINSTANCE.getBook_Author(); + + /** + * The meta object literal for the '<em><b>Test</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute BOOK__TEST = eINSTANCE.getBook_Test(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.CityImpl <em>City</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.CityImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getCity() + * @generated + */ + EClass CITY = eINSTANCE.getCity(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute CITY__NAME = eINSTANCE.getCity_Name(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl <em>Library</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getLibrary() + * @generated + */ + EClass LIBRARY = eINSTANCE.getLibrary(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute LIBRARY__NAME = eINSTANCE.getLibrary_Name(); + + /** + * The meta object literal for the '<em><b>Writers</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference LIBRARY__WRITERS = eINSTANCE.getLibrary_Writers(); + + /** + * The meta object literal for the '<em><b>Books</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference LIBRARY__BOOKS = eINSTANCE.getLibrary_Books(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl <em>Writer</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getWriter() + * @generated + */ + EClass WRITER = eINSTANCE.getWriter(); + + /** + * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute WRITER__NAME = eINSTANCE.getWriter_Name(); + + /** + * The meta object literal for the '<em><b>Books</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference WRITER__BOOKS = eINSTANCE.getWriter_Books(); + + /** + * The meta object literal for the '<em><b>City</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference WRITER__CITY = eINSTANCE.getWriter_City(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory <em>Book Category</em>}' enum. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBookCategory() + * @generated + */ + EEnum BOOK_CATEGORY = eINSTANCE.getBookCategory(); + + /** + * The meta object literal for the '<em>Book Category Object</em>' data type. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.EavlibraryPackageImpl#getBookCategoryObject() + * @generated + */ + EDataType BOOK_CATEGORY_OBJECT = eINSTANCE.getBookCategoryObject(); + + } + +} //EavlibraryPackage diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Library.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Library.java new file mode 100644 index 000000000..a675da3e5 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Library.java @@ -0,0 +1,94 @@ +/** + * <copyright> + * </copyright> + * + * $Id: Library.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Library</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getWriters <em>Writers</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getBooks <em>Books</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getLibrary() + * @model extendedMetaData="name='Library' kind='elementOnly'" + * @generated + */ +public interface Library extends EObject { + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getLibrary_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='element' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the '<em><b>Writers</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Writers</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Writers</em>' containment reference list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getLibrary_Writers() + * @model containment="true" + * annotation="teneo.hibernate appinfo='@Fetch(SUBSELECT) @ForeignKey(name=\"schrijvers\")'" + * extendedMetaData="kind='element' name='writers'" + * @generated + */ + EList<Writer> getWriters(); + + /** + * Returns the value of the '<em><b>Books</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Books</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Books</em>' containment reference list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getLibrary_Books() + * @model containment="true" + * extendedMetaData="kind='element' name='books'" + * @generated + */ + EList<Book> getBooks(); + +} // Library diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java new file mode 100644 index 000000000..7523fd773 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/Writer.java @@ -0,0 +1,106 @@ +/** + * <copyright> + * </copyright> + * + * $Id: Writer.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Writer</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getBooks <em>Books</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getCity <em>City</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getWriter() + * @model annotation="teneo.jpa appinfo='@EAVMapping'" + * extendedMetaData="name='Writer' kind='elementOnly'" + * @generated + */ +public interface Writer extends EObject { + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getWriter_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * extendedMetaData="kind='element' name='name'" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the '<em><b>Books</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor <em>Author</em>}'. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Books</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Books</em>' reference list. + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getWriter_Books() + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book#getAuthor + * @model opposite="author" + * extendedMetaData="kind='element' name='books'" + * @generated + */ + EList<Book> getBooks(); + + /** + * Returns the value of the '<em><b>City</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>City</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>City</em>' reference. + * @see #setCity(City) + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#getWriter_City() + * @model required="true" + * extendedMetaData="kind='element' name='city'" + * @generated + */ + City getCity(); + + /** + * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer#getCity <em>City</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>City</em>' reference. + * @see #getCity() + * @generated + */ + void setCity(City value); + +} // Writer diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/BookImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/BookImpl.java new file mode 100644 index 000000000..f43b2fe72 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/BookImpl.java @@ -0,0 +1,547 @@ +/** + * <copyright> + * </copyright> + * + * $Id: BookImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +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.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Book</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl#getTitle <em>Title</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl#getPages <em>Pages</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl#getCategory <em>Category</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl#getAuthor <em>Author</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.BookImpl#getTest <em>Test</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class BookImpl extends EObjectImpl implements Book { + /** + * The default value of the '{@link #getTitle() <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTitle() + * @generated + * @ordered + */ + protected static final String TITLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTitle() + * @generated + * @ordered + */ + protected String title = TITLE_EDEFAULT; + + /** + * The default value of the '{@link #getPages() <em>Pages</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPages() + * @generated + * @ordered + */ + protected static final int PAGES_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getPages() <em>Pages</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPages() + * @generated + * @ordered + */ + protected int pages = PAGES_EDEFAULT; + + /** + * This is true if the Pages attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean pagesESet; + + /** + * The default value of the '{@link #getCategory() <em>Category</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCategory() + * @generated + * @ordered + */ + protected static final BookCategory CATEGORY_EDEFAULT = BookCategory.MYSTERY; + + /** + * The cached value of the '{@link #getCategory() <em>Category</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCategory() + * @generated + * @ordered + */ + protected BookCategory category = CATEGORY_EDEFAULT; + + /** + * This is true if the Category attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean categoryESet; + + /** + * The cached value of the '{@link #getAuthor() <em>Author</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAuthor() + * @generated + * @ordered + */ + protected Writer author; + + /** + * The default value of the '{@link #getTest() <em>Test</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTest() + * @generated + * @ordered + */ + protected static final int TEST_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getTest() <em>Test</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTest() + * @generated + * @ordered + */ + protected int test = TEST_EDEFAULT; + + /** + * This is true if the Test attribute has been set. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + protected boolean testESet; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BookImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return EavlibraryPackage.Literals.BOOK; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getTitle() { + return title; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setTitle(String newTitle) { + String oldTitle = title; + title = newTitle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__TITLE, oldTitle, title)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getPages() { + return pages; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setPages(int newPages) { + int oldPages = pages; + pages = newPages; + boolean oldPagesESet = pagesESet; + pagesESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__PAGES, oldPages, pages, !oldPagesESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetPages() { + int oldPages = pages; + boolean oldPagesESet = pagesESet; + pages = PAGES_EDEFAULT; + pagesESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, EavlibraryPackage.BOOK__PAGES, oldPages, PAGES_EDEFAULT, oldPagesESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetPages() { + return pagesESet; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BookCategory getCategory() { + return category; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCategory(BookCategory newCategory) { + BookCategory oldCategory = category; + category = newCategory == null ? CATEGORY_EDEFAULT : newCategory; + boolean oldCategoryESet = categoryESet; + categoryESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__CATEGORY, oldCategory, category, !oldCategoryESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetCategory() { + BookCategory oldCategory = category; + boolean oldCategoryESet = categoryESet; + category = CATEGORY_EDEFAULT; + categoryESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, EavlibraryPackage.BOOK__CATEGORY, oldCategory, CATEGORY_EDEFAULT, oldCategoryESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetCategory() { + return categoryESet; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Writer getAuthor() { + if (author != null && author.eIsProxy()) { + InternalEObject oldAuthor = (InternalEObject)author; + author = (Writer)eResolveProxy(oldAuthor); + if (author != oldAuthor) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, EavlibraryPackage.BOOK__AUTHOR, oldAuthor, author)); + } + } + return author; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Writer basicGetAuthor() { + return author; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetAuthor(Writer newAuthor, NotificationChain msgs) { + Writer oldAuthor = author; + author = newAuthor; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__AUTHOR, oldAuthor, newAuthor); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setAuthor(Writer newAuthor) { + if (newAuthor != author) { + NotificationChain msgs = null; + if (author != null) + msgs = ((InternalEObject)author).eInverseRemove(this, EavlibraryPackage.WRITER__BOOKS, Writer.class, msgs); + if (newAuthor != null) + msgs = ((InternalEObject)newAuthor).eInverseAdd(this, EavlibraryPackage.WRITER__BOOKS, Writer.class, msgs); + msgs = basicSetAuthor(newAuthor, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__AUTHOR, newAuthor, newAuthor)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getTest() { + return test; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setTest(int newTest) { + int oldTest = test; + test = newTest; + boolean oldTestESet = testESet; + testESet = true; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.BOOK__TEST, oldTest, test, !oldTestESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void unsetTest() { + int oldTest = test; + boolean oldTestESet = testESet; + test = TEST_EDEFAULT; + testESet = false; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.UNSET, EavlibraryPackage.BOOK__TEST, oldTest, TEST_EDEFAULT, oldTestESet)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isSetTest() { + return testESet; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EavlibraryPackage.BOOK__AUTHOR: + if (author != null) + msgs = ((InternalEObject)author).eInverseRemove(this, EavlibraryPackage.WRITER__BOOKS, Writer.class, msgs); + return basicSetAuthor((Writer)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EavlibraryPackage.BOOK__AUTHOR: + return basicSetAuthor(null, 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 EavlibraryPackage.BOOK__TITLE: + return getTitle(); + case EavlibraryPackage.BOOK__PAGES: + return getPages(); + case EavlibraryPackage.BOOK__CATEGORY: + return getCategory(); + case EavlibraryPackage.BOOK__AUTHOR: + if (resolve) return getAuthor(); + return basicGetAuthor(); + case EavlibraryPackage.BOOK__TEST: + return getTest(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case EavlibraryPackage.BOOK__TITLE: + setTitle((String)newValue); + return; + case EavlibraryPackage.BOOK__PAGES: + setPages((Integer)newValue); + return; + case EavlibraryPackage.BOOK__CATEGORY: + setCategory((BookCategory)newValue); + return; + case EavlibraryPackage.BOOK__AUTHOR: + setAuthor((Writer)newValue); + return; + case EavlibraryPackage.BOOK__TEST: + setTest((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EavlibraryPackage.BOOK__TITLE: + setTitle(TITLE_EDEFAULT); + return; + case EavlibraryPackage.BOOK__PAGES: + unsetPages(); + return; + case EavlibraryPackage.BOOK__CATEGORY: + unsetCategory(); + return; + case EavlibraryPackage.BOOK__AUTHOR: + setAuthor((Writer)null); + return; + case EavlibraryPackage.BOOK__TEST: + unsetTest(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EavlibraryPackage.BOOK__TITLE: + return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title); + case EavlibraryPackage.BOOK__PAGES: + return isSetPages(); + case EavlibraryPackage.BOOK__CATEGORY: + return isSetCategory(); + case EavlibraryPackage.BOOK__AUTHOR: + return author != null; + case EavlibraryPackage.BOOK__TEST: + return isSetTest(); + } + 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(" (title: "); + result.append(title); + result.append(", pages: "); + if (pagesESet) result.append(pages); else result.append("<unset>"); + result.append(", category: "); + if (categoryESet) result.append(category); else result.append("<unset>"); + result.append(", test: "); + if (testESet) result.append(test); else result.append("<unset>"); + result.append(')'); + return result.toString(); + } + +} //BookImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/CityImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/CityImpl.java new file mode 100644 index 000000000..a7615bbdf --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/CityImpl.java @@ -0,0 +1,167 @@ +/** + * <copyright> + * </copyright> + * + * $Id: CityImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.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.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>City</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.CityImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class CityImpl extends EObjectImpl implements City { + /** + * 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; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected CityImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return EavlibraryPackage.Literals.CITY; + } + + /** + * <!-- 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, EavlibraryPackage.CITY__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case EavlibraryPackage.CITY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case EavlibraryPackage.CITY__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EavlibraryPackage.CITY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EavlibraryPackage.CITY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + 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(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //CityImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryFactoryImpl.java new file mode 100644 index 000000000..0d7903402 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryFactoryImpl.java @@ -0,0 +1,205 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryFactoryImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl; + +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.teneo.samples.emf.annotations.eavlibrary.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class EavlibraryFactoryImpl extends EFactoryImpl implements EavlibraryFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static EavlibraryFactory init() { + try { + EavlibraryFactory theEavlibraryFactory = (EavlibraryFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/teneo/samples/emf/annotations/eavlibrary"); + if (theEavlibraryFactory != null) { + return theEavlibraryFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new EavlibraryFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case EavlibraryPackage.BOOK: return createBook(); + case EavlibraryPackage.CITY: return createCity(); + case EavlibraryPackage.LIBRARY: return createLibrary(); + case EavlibraryPackage.WRITER: return createWriter(); + 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 EavlibraryPackage.BOOK_CATEGORY: + return createBookCategoryFromString(eDataType, initialValue); + case EavlibraryPackage.BOOK_CATEGORY_OBJECT: + return createBookCategoryObjectFromString(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 EavlibraryPackage.BOOK_CATEGORY: + return convertBookCategoryToString(eDataType, instanceValue); + case EavlibraryPackage.BOOK_CATEGORY_OBJECT: + return convertBookCategoryObjectToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Book createBook() { + BookImpl book = new BookImpl(); + return book; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public City createCity() { + CityImpl city = new CityImpl(); + return city; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Library createLibrary() { + LibraryImpl library = new LibraryImpl(); + return library; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Writer createWriter() { + WriterImpl writer = new WriterImpl(); + return writer; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BookCategory createBookCategoryFromString(EDataType eDataType, String initialValue) { + BookCategory result = BookCategory.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 convertBookCategoryToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BookCategory createBookCategoryObjectFromString(EDataType eDataType, String initialValue) { + return createBookCategoryFromString(EavlibraryPackage.Literals.BOOK_CATEGORY, initialValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String convertBookCategoryObjectToString(EDataType eDataType, Object instanceValue) { + return convertBookCategoryToString(EavlibraryPackage.Literals.BOOK_CATEGORY, instanceValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryPackage getEavlibraryPackage() { + return (EavlibraryPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static EavlibraryPackage getPackage() { + return EavlibraryPackage.eINSTANCE; + } + +} //EavlibraryFactoryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java new file mode 100644 index 000000000..cfacebdf9 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/EavlibraryPackageImpl.java @@ -0,0 +1,605 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryPackageImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryFactory; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class EavlibraryPackageImpl extends EPackageImpl implements EavlibraryPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass bookEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass cityEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass libraryEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass writerEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EEnum bookCategoryEEnum = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EDataType bookCategoryObjectEDataType = 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 org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage#eNS_URI + * @see #init() + * @generated + */ + private EavlibraryPackageImpl() { + super(eNS_URI, EavlibraryFactory.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 EavlibraryPackage#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 EavlibraryPackage init() { + if (isInited) return (EavlibraryPackage)EPackage.Registry.INSTANCE.getEPackage(EavlibraryPackage.eNS_URI); + + // Obtain or create and register package + EavlibraryPackageImpl theEavlibraryPackage = (EavlibraryPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EavlibraryPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EavlibraryPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theEavlibraryPackage.createPackageContents(); + + // Initialize created meta-data + theEavlibraryPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theEavlibraryPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(EavlibraryPackage.eNS_URI, theEavlibraryPackage); + return theEavlibraryPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getBook() { + return bookEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getBook_Title() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getBook_Pages() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getBook_Category() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getBook_Author() { + return (EReference)bookEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getBook_Test() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getCity() { + return cityEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getCity_Name() { + return (EAttribute)cityEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getLibrary() { + return libraryEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getLibrary_Name() { + return (EAttribute)libraryEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getLibrary_Writers() { + return (EReference)libraryEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getLibrary_Books() { + return (EReference)libraryEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getWriter() { + return writerEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getWriter_Name() { + return (EAttribute)writerEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getWriter_Books() { + return (EReference)writerEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getWriter_City() { + return (EReference)writerEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EEnum getBookCategory() { + return bookCategoryEEnum; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EDataType getBookCategoryObject() { + return bookCategoryObjectEDataType; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryFactory getEavlibraryFactory() { + return (EavlibraryFactory)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 + bookEClass = createEClass(BOOK); + createEAttribute(bookEClass, BOOK__TITLE); + createEAttribute(bookEClass, BOOK__PAGES); + createEAttribute(bookEClass, BOOK__CATEGORY); + createEReference(bookEClass, BOOK__AUTHOR); + createEAttribute(bookEClass, BOOK__TEST); + + cityEClass = createEClass(CITY); + createEAttribute(cityEClass, CITY__NAME); + + libraryEClass = createEClass(LIBRARY); + createEAttribute(libraryEClass, LIBRARY__NAME); + createEReference(libraryEClass, LIBRARY__WRITERS); + createEReference(libraryEClass, LIBRARY__BOOKS); + + writerEClass = createEClass(WRITER); + createEAttribute(writerEClass, WRITER__NAME); + createEReference(writerEClass, WRITER__BOOKS); + createEReference(writerEClass, WRITER__CITY); + + // Create enums + bookCategoryEEnum = createEEnum(BOOK_CATEGORY); + + // Create data types + bookCategoryObjectEDataType = createEDataType(BOOK_CATEGORY_OBJECT); + } + + /** + * <!-- 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); + + // Obtain other dependent packages + XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(bookEClass, Book.class, "Book", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getBook_Title(), theXMLTypePackage.getID(), "title", null, 1, 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBook_Pages(), theXMLTypePackage.getInt(), "pages", null, 1, 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBook_Category(), this.getBookCategory(), "category", null, 1, 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getBook_Author(), this.getWriter(), this.getWriter_Books(), "author", null, 1, 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getBook_Test(), theXMLTypePackage.getInt(), "test", null, 0, 1, Book.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(cityEClass, City.class, "City", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCity_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, City.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(libraryEClass, Library.class, "Library", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getLibrary_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Library.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getLibrary_Writers(), this.getWriter(), null, "writers", null, 0, -1, Library.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getLibrary_Books(), this.getBook(), null, "books", null, 0, -1, Library.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(writerEClass, Writer.class, "Writer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getWriter_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, Writer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWriter_Books(), this.getBook(), this.getBook_Author(), "books", null, 0, -1, Writer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getWriter_City(), this.getCity(), null, "city", null, 1, 1, Writer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(bookCategoryEEnum, BookCategory.class, "BookCategory"); + addEEnumLiteral(bookCategoryEEnum, BookCategory.MYSTERY); + addEEnumLiteral(bookCategoryEEnum, BookCategory.SCIENCE_FICTION); + addEEnumLiteral(bookCategoryEEnum, BookCategory.BIOGRAPHY); + + // Initialize data types + initEDataType(bookCategoryObjectEDataType, BookCategory.class, "BookCategoryObject", IS_SERIALIZABLE, IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + // teneo.jpa + createTeneoAnnotations(); + // teneo.hibernate + createTeneo_1Annotations(); + } + + /** + * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation + (bookEClass, + source, + new String[] { + "name", "Book", + "kind", "elementOnly" + }); + addAnnotation + (getBook_Title(), + source, + new String[] { + "kind", "element", + "name", "title" + }); + addAnnotation + (getBook_Pages(), + source, + new String[] { + "kind", "element", + "name", "pages" + }); + addAnnotation + (getBook_Category(), + source, + new String[] { + "kind", "element", + "name", "category" + }); + addAnnotation + (getBook_Author(), + source, + new String[] { + "kind", "element", + "name", "author" + }); + addAnnotation + (getBook_Test(), + source, + new String[] { + "kind", "attribute", + "name", "test" + }); + addAnnotation + (bookCategoryEEnum, + source, + new String[] { + "name", "BookCategory" + }); + addAnnotation + (bookCategoryObjectEDataType, + source, + new String[] { + "name", "BookCategory:Object", + "baseType", "BookCategory" + }); + addAnnotation + (cityEClass, + source, + new String[] { + "name", "City", + "kind", "elementOnly" + }); + addAnnotation + (getCity_Name(), + source, + new String[] { + "kind", "element", + "name", "name" + }); + addAnnotation + (libraryEClass, + source, + new String[] { + "name", "Library", + "kind", "elementOnly" + }); + addAnnotation + (getLibrary_Name(), + source, + new String[] { + "kind", "element", + "name", "name" + }); + addAnnotation + (getLibrary_Writers(), + source, + new String[] { + "kind", "element", + "name", "writers" + }); + addAnnotation + (getLibrary_Books(), + source, + new String[] { + "kind", "element", + "name", "books" + }); + addAnnotation + (writerEClass, + source, + new String[] { + "name", "Writer", + "kind", "elementOnly" + }); + addAnnotation + (getWriter_Name(), + source, + new String[] { + "kind", "element", + "name", "name" + }); + addAnnotation + (getWriter_Books(), + source, + new String[] { + "kind", "element", + "name", "books" + }); + addAnnotation + (getWriter_City(), + source, + new String[] { + "kind", "element", + "name", "city" + }); + } + + /** + * Initializes the annotations for <b>teneo.jpa</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createTeneoAnnotations() { + String source = "teneo.jpa"; + addAnnotation + (getBook_Category(), + source, + new String[] { + "appinfo", "@Enumerated(ORDINAL)" + }); + addAnnotation + (writerEClass, + source, + new String[] { + "appinfo", "@EAVMapping" + }); + } + + /** + * Initializes the annotations for <b>teneo.hibernate</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void createTeneo_1Annotations() { + String source = "teneo.hibernate"; + addAnnotation + (getLibrary_Writers(), + source, + new String[] { + "appinfo", "@Fetch(SUBSELECT) @ForeignKey(name=\"schrijvers\")" + }); + } + +} //EavlibraryPackageImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/LibraryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/LibraryImpl.java new file mode 100644 index 000000000..b23b2b10a --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/LibraryImpl.java @@ -0,0 +1,263 @@ +/** + * <copyright> + * </copyright> + * + * $Id: LibraryImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.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.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Library</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl#getWriters <em>Writers</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.LibraryImpl#getBooks <em>Books</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class LibraryImpl extends EObjectImpl implements Library { + /** + * 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 #getWriters() <em>Writers</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getWriters() + * @generated + * @ordered + */ + protected EList<Writer> writers; + + /** + * The cached value of the '{@link #getBooks() <em>Books</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBooks() + * @generated + * @ordered + */ + protected EList<Book> books; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected LibraryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return EavlibraryPackage.Literals.LIBRARY; + } + + /** + * <!-- 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, EavlibraryPackage.LIBRARY__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Writer> getWriters() { + if (writers == null) { + writers = new EObjectContainmentEList<Writer>(Writer.class, this, EavlibraryPackage.LIBRARY__WRITERS); + } + return writers; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Book> getBooks() { + if (books == null) { + books = new EObjectContainmentEList<Book>(Book.class, this, EavlibraryPackage.LIBRARY__BOOKS); + } + return books; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EavlibraryPackage.LIBRARY__WRITERS: + return ((InternalEList<?>)getWriters()).basicRemove(otherEnd, msgs); + case EavlibraryPackage.LIBRARY__BOOKS: + return ((InternalEList<?>)getBooks()).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 EavlibraryPackage.LIBRARY__NAME: + return getName(); + case EavlibraryPackage.LIBRARY__WRITERS: + return getWriters(); + case EavlibraryPackage.LIBRARY__BOOKS: + return getBooks(); + } + 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 EavlibraryPackage.LIBRARY__NAME: + setName((String)newValue); + return; + case EavlibraryPackage.LIBRARY__WRITERS: + getWriters().clear(); + getWriters().addAll((Collection<? extends Writer>)newValue); + return; + case EavlibraryPackage.LIBRARY__BOOKS: + getBooks().clear(); + getBooks().addAll((Collection<? extends Book>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EavlibraryPackage.LIBRARY__NAME: + setName(NAME_EDEFAULT); + return; + case EavlibraryPackage.LIBRARY__WRITERS: + getWriters().clear(); + return; + case EavlibraryPackage.LIBRARY__BOOKS: + getBooks().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EavlibraryPackage.LIBRARY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case EavlibraryPackage.LIBRARY__WRITERS: + return writers != null && !writers.isEmpty(); + case EavlibraryPackage.LIBRARY__BOOKS: + return books != null && !books.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(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //LibraryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/WriterImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/WriterImpl.java new file mode 100644 index 000000000..2544571d1 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/impl/WriterImpl.java @@ -0,0 +1,302 @@ +/** + * <copyright> + * </copyright> + * + * $Id: WriterImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.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.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Writer</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl#getBooks <em>Books</em>}</li> + * <li>{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.impl.WriterImpl#getCity <em>City</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class WriterImpl extends EObjectImpl implements Writer { + /** + * 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 #getBooks() <em>Books</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBooks() + * @generated + * @ordered + */ + protected EList<Book> books; + + /** + * The cached value of the '{@link #getCity() <em>City</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCity() + * @generated + * @ordered + */ + protected City city; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected WriterImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return EavlibraryPackage.Literals.WRITER; + } + + /** + * <!-- 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, EavlibraryPackage.WRITER__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Book> getBooks() { + if (books == null) { + books = new EObjectWithInverseResolvingEList<Book>(Book.class, this, EavlibraryPackage.WRITER__BOOKS, EavlibraryPackage.BOOK__AUTHOR); + } + return books; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public City getCity() { + if (city != null && city.eIsProxy()) { + InternalEObject oldCity = (InternalEObject)city; + city = (City)eResolveProxy(oldCity); + if (city != oldCity) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, EavlibraryPackage.WRITER__CITY, oldCity, city)); + } + } + return city; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public City basicGetCity() { + return city; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCity(City newCity) { + City oldCity = city; + city = newCity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EavlibraryPackage.WRITER__CITY, oldCity, city)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EavlibraryPackage.WRITER__BOOKS: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getBooks()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EavlibraryPackage.WRITER__BOOKS: + return ((InternalEList<?>)getBooks()).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 EavlibraryPackage.WRITER__NAME: + return getName(); + case EavlibraryPackage.WRITER__BOOKS: + return getBooks(); + case EavlibraryPackage.WRITER__CITY: + if (resolve) return getCity(); + return basicGetCity(); + } + 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 EavlibraryPackage.WRITER__NAME: + setName((String)newValue); + return; + case EavlibraryPackage.WRITER__BOOKS: + getBooks().clear(); + getBooks().addAll((Collection<? extends Book>)newValue); + return; + case EavlibraryPackage.WRITER__CITY: + setCity((City)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EavlibraryPackage.WRITER__NAME: + setName(NAME_EDEFAULT); + return; + case EavlibraryPackage.WRITER__BOOKS: + getBooks().clear(); + return; + case EavlibraryPackage.WRITER__CITY: + setCity((City)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EavlibraryPackage.WRITER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case EavlibraryPackage.WRITER__BOOKS: + return books != null && !books.isEmpty(); + case EavlibraryPackage.WRITER__CITY: + return city != 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(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} //WriterImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryAdapterFactory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryAdapterFactory.java new file mode 100644 index 000000000..4dfac2fb7 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryAdapterFactory.java @@ -0,0 +1,178 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryAdapterFactory.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.*; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage + * @generated + */ +public class EavlibraryAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static EavlibraryPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryAdapterFactory() { + if (modelPackage == null) { + modelPackage = EavlibraryPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected EavlibrarySwitch<Adapter> modelSwitch = + new EavlibrarySwitch<Adapter>() { + @Override + public Adapter caseBook(Book object) { + return createBookAdapter(); + } + @Override + public Adapter caseCity(City object) { + return createCityAdapter(); + } + @Override + public Adapter caseLibrary(Library object) { + return createLibraryAdapter(); + } + @Override + public Adapter caseWriter(Writer object) { + return createWriterAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book <em>Book</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.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book + * @generated + */ + public Adapter createBookAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City <em>City</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.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City + * @generated + */ + public Adapter createCityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library <em>Library</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.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library + * @generated + */ + public Adapter createLibraryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer <em>Writer</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.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer + * @generated + */ + public Adapter createWriterAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //EavlibraryAdapterFactory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceFactoryImpl.java new file mode 100644 index 000000000..6b4f26606 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceFactoryImpl.java @@ -0,0 +1,56 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryResourceFactoryImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.resource.Resource; + +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * <!-- begin-user-doc --> + * The <b>Resource Factory</b> associated with the package. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util.EavlibraryResourceImpl + * @generated + */ +public class EavlibraryResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Resource createResource(URI uri) { + XMLResource result = new EavlibraryResourceImpl(uri); + result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + + result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); + return result; + } + +} //EavlibraryResourceFactoryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceImpl.java new file mode 100644 index 000000000..60d41e065 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryResourceImpl.java @@ -0,0 +1,32 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryResourceImpl.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * <!-- begin-user-doc --> + * The <b>Resource </b> associated with the package. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util.EavlibraryResourceFactoryImpl + * @generated + */ +public class EavlibraryResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param uri the URI of the new resource. + * @generated + */ + public EavlibraryResourceImpl(URI uri) { + super(uri); + } + +} //EavlibraryResourceImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java new file mode 100644 index 000000000..01c369987 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibrarySwitch.java @@ -0,0 +1,193 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibrarySwitch.java,v 1.1 2009/08/21 15:01:55 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util; + +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.*; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage + * @generated + */ +public class EavlibrarySwitch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static EavlibraryPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibrarySwitch() { + if (modelPackage == null) { + modelPackage = EavlibraryPackage.eINSTANCE; + } + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else { + List<EClass> eSuperTypes = theEClass.getESuperTypes(); + return + eSuperTypes.isEmpty() ? + defaultCase(theEObject) : + doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case EavlibraryPackage.BOOK: { + Book book = (Book)theEObject; + T result = caseBook(book); + if (result == null) result = defaultCase(theEObject); + return result; + } + case EavlibraryPackage.CITY: { + City city = (City)theEObject; + T result = caseCity(city); + if (result == null) result = defaultCase(theEObject); + return result; + } + case EavlibraryPackage.LIBRARY: { + Library library = (Library)theEObject; + T result = caseLibrary(library); + if (result == null) result = defaultCase(theEObject); + return result; + } + case EavlibraryPackage.WRITER: { + Writer writer = (Writer)theEObject; + T result = caseWriter(writer); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Book</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>Book</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBook(Book object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>City</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>City</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCity(City object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Library</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>Library</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLibrary(Library object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Writer</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>Writer</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseWriter(Writer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //EavlibrarySwitch diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryXMLProcessor.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryXMLProcessor.java new file mode 100644 index 000000000..7afc7a870 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/util/EavlibraryXMLProcessor.java @@ -0,0 +1,54 @@ +/** + * <copyright> + * </copyright> + * + * $Id: EavlibraryXMLProcessor.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.util; + +import java.util.Map; + +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.resource.Resource; + +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.EavlibraryPackage; + +/** + * This class contains helper methods to serialize and deserialize XML documents + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class EavlibraryXMLProcessor extends XMLProcessor { + + /** + * Public constructor to instantiate the helper. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EavlibraryXMLProcessor() { + super((EPackage.Registry.INSTANCE)); + EavlibraryPackage.eINSTANCE.eClass(); + } + + /** + * Register for "*" and "xml" file extensions the EavlibraryResourceFactoryImpl factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected Map<String, Resource.Factory> getRegistrations() { + if (registrations == null) { + super.getRegistrations(); + registrations.put(XML_EXTENSION, new EavlibraryResourceFactoryImpl()); + registrations.put(STAR_EXTENSION, new EavlibraryResourceFactoryImpl()); + } + return registrations; + } + +} //EavlibraryXMLProcessor diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/BookValidator.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/BookValidator.java new file mode 100644 index 000000000..e80a9ac99 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/BookValidator.java @@ -0,0 +1,26 @@ +/** + * <copyright> + * </copyright> + * + * $Id: BookValidator.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.validation; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.BookCategory; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * A sample validator interface for {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book}. + * This doesn't really do anything, and it's not a real EMF artifact. + * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. + * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + */ +public interface BookValidator { + boolean validate(); + + boolean validateTitle(String value); + boolean validatePages(int value); + boolean validateCategory(BookCategory value); + boolean validateAuthor(Writer value); + boolean validateTest(int value); +} diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/CityValidator.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/CityValidator.java new file mode 100644 index 000000000..9f9f3517b --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/CityValidator.java @@ -0,0 +1,20 @@ +/** + * <copyright> + * </copyright> + * + * $Id: CityValidator.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.validation; + + +/** + * A sample validator interface for {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City}. + * This doesn't really do anything, and it's not a real EMF artifact. + * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. + * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + */ +public interface CityValidator { + boolean validate(); + + boolean validateName(String value); +} diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/LibraryValidator.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/LibraryValidator.java new file mode 100644 index 000000000..b976aa9a9 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/LibraryValidator.java @@ -0,0 +1,26 @@ +/** + * <copyright> + * </copyright> + * + * $Id: LibraryValidator.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.validation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer; + +/** + * A sample validator interface for {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Library}. + * This doesn't really do anything, and it's not a real EMF artifact. + * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. + * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + */ +public interface LibraryValidator { + boolean validate(); + + boolean validateName(String value); + boolean validateWriters(EList<Writer> value); + boolean validateBooks(EList<Book> value); +} diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/WriterValidator.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/WriterValidator.java new file mode 100644 index 000000000..9a0a8a8b9 --- /dev/null +++ b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/annotations/eavlibrary/validation/WriterValidator.java @@ -0,0 +1,26 @@ +/** + * <copyright> + * </copyright> + * + * $Id: WriterValidator.java,v 1.1 2009/08/21 15:01:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.validation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Book; +import org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.City; + +/** + * A sample validator interface for {@link org.eclipse.emf.teneo.samples.emf.annotations.eavlibrary.Writer}. + * This doesn't really do anything, and it's not a real EMF artifact. + * It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended. + * This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + */ +public interface WriterValidator { + boolean validate(); + + boolean validateName(String value); + boolean validateBooks(EList<Book> value); + boolean validateCity(City value); +} |