Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 9084 invoked from network); 5 Dec 2006 02:27:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2006 02:27:49 -0000 Received: (qmail 70883 invoked by uid 500); 5 Dec 2006 02:27:57 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 70853 invoked by uid 500); 5 Dec 2006 02:27:57 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 70842 invoked by uid 99); 5 Dec 2006 02:27:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:27:57 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Dec 2006 18:27:46 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 9AE8F1A984D; Mon, 4 Dec 2006 18:27:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r482460 [2/2] - in /directory/sandbox/oersoy/library-maven: ./ META-INF/ model/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/eclipse/ src/main/java/org/eclipse/example/ src/main/java/org/eclip... Date: Tue, 05 Dec 2006 02:27:04 -0000 To: commits@directory.apache.org From: oersoy@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061205022705.9AE8F1A984D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/LibraryPackageImpl.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/LibraryPackageImpl.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/LibraryPackageImpl.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/LibraryPackageImpl.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,486 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.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.ecore.xml.type.impl.XMLTypePackageImpl; + +import org.eclipse.example.library.Book; +import org.eclipse.example.library.BookCategory; +import org.eclipse.example.library.Library; +import org.eclipse.example.library.LibraryFactory; +import org.eclipse.example.library.LibraryPackage; +import org.eclipse.example.library.Writer; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class LibraryPackageImpl extends EPackageImpl implements LibraryPackage { + /** + * + * + * @generated + */ + private EClass bookEClass = null; + + /** + * + * + * @generated + */ + private EClass libraryEClass = null; + + /** + * + * + * @generated + */ + private EClass writerEClass = null; + + /** + * + * + * @generated + */ + private EEnum bookCategoryEEnum = null; + + /** + * + * + * @generated + */ + private EDataType bookCategoryObjectEDataType = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

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. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.example.library.LibraryPackage#eNS_URI + * @see #init() + * @generated + */ + private LibraryPackageImpl() { + super(eNS_URI, LibraryFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this + * model, and for any others upon which it depends. Simple + * dependencies are satisfied by calling this method on all + * dependent packages before doing anything else. This method drives + * initialization for interdependent packages directly, in parallel + * with this package, itself. + *

Of this package and its interdependencies, all packages which + * have not yet been registered by their URI values are first created + * and registered. The packages are then initialized in two steps: + * meta-model objects for all of the packages are created before any + * are initialized, since one package's meta-model objects may refer to + * those of another. + *

Invocation of this method will not affect any packages that have + * already been initialized. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static LibraryPackage init() { + if (isInited) return (LibraryPackage)EPackage.Registry.INSTANCE.getEPackage(LibraryPackage.eNS_URI); + + // Obtain or create and register package + LibraryPackageImpl theLibraryPackage = (LibraryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof LibraryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new LibraryPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + XMLTypePackageImpl.init(); + + // Create package meta-data objects + theLibraryPackage.createPackageContents(); + + // Initialize created meta-data + theLibraryPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theLibraryPackage.freeze(); + + return theLibraryPackage; + } + + /** + * + * + * @generated + */ + public EClass getBook() { + return bookEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getBook_Title() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getBook_Pages() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getBook_Category() { + return (EAttribute)bookEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EReference getBook_Author() { + return (EReference)bookEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EClass getLibrary() { + return libraryEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getLibrary_Name() { + return (EAttribute)libraryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getLibrary_Writers() { + return (EReference)libraryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getLibrary_Books() { + return (EReference)libraryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getWriter() { + return writerEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getWriter_Name() { + return (EAttribute)writerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getWriter_Books() { + return (EReference)writerEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EEnum getBookCategory() { + return bookCategoryEEnum; + } + + /** + * + * + * @generated + */ + public EDataType getBookCategoryObject() { + return bookCategoryObjectEDataType; + } + + /** + * + * + * @generated + */ + public LibraryFactory getLibraryFactory() { + return (LibraryFactory)getEFactoryInstance(); + } + + /** + * + * + * @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. + * + * + * @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); + + 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); + + // Create enums + bookCategoryEEnum = createEEnum(BOOK_CATEGORY); + + // Create data types + bookCategoryObjectEDataType = createEDataType(BOOK_CATEGORY_OBJECT); + } + + /** + * + * + * @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. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + XMLTypePackageImpl theXMLTypePackage = (XMLTypePackageImpl)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + + // 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.getString(), "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", "Mystery", 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); + + 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); + + // Initialize enums and add enum literals + initEEnum(bookCategoryEEnum, BookCategory.class, "BookCategory"); + addEEnumLiteral(bookCategoryEEnum, BookCategory.MYSTERY_LITERAL); + addEEnumLiteral(bookCategoryEEnum, BookCategory.SCIENCE_FICTION_LITERAL); + addEEnumLiteral(bookCategoryEEnum, BookCategory.BIOGRAPHY_LITERAL); + + // 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(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @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 + (bookCategoryEEnum, + source, + new String[] { + "name", "BookCategory" + }); + addAnnotation + (bookCategoryObjectEDataType, + source, + new String[] { + "name", "BookCategory:Object", + "baseType", "BookCategory" + }); + 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" + }); + } + +} //LibraryPackageImpl Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/WriterImpl.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/WriterImpl.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/WriterImpl.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/impl/WriterImpl.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,242 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.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.EStructuralFeature; +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.example.library.Book; +import org.eclipse.example.library.LibraryPackage; +import org.eclipse.example.library.Writer; + +/** + * + * An implementation of the model object 'Writer'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.example.library.impl.WriterImpl#getName Name}
  • + *
  • {@link org.eclipse.example.library.impl.WriterImpl#getBooks Books}
  • + *
+ *

+ * + * @generated + */ +public class WriterImpl extends EObjectImpl implements Writer { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getBooks() Books}' reference list. + * + * + * @see #getBooks() + * @generated + * @ordered + */ + protected EList books = null; + + /** + * + * + * @generated + */ + protected WriterImpl() { + super(); + } + + /** + * + * + * @generated + */ + protected EClass eStaticClass() { + return LibraryPackage.eINSTANCE.getWriter(); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, LibraryPackage.WRITER__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public EList getBooks() { + if (books == null) { + books = new EObjectWithInverseResolvingEList(Book.class, this, LibraryPackage.WRITER__BOOKS, LibraryPackage.BOOK__AUTHOR); + } + return books; + } + + /** + * + * + * @generated + */ + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { + if (featureID >= 0) { + switch (eDerivedStructuralFeatureID(featureID, baseClass)) { + case LibraryPackage.WRITER__BOOKS: + return ((InternalEList)getBooks()).basicAdd(otherEnd, msgs); + default: + return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs); + } + } + if (eContainer != null) + msgs = eBasicRemoveFromContainer(msgs); + return eBasicSetContainer(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { + if (featureID >= 0) { + switch (eDerivedStructuralFeatureID(featureID, baseClass)) { + case LibraryPackage.WRITER__BOOKS: + return ((InternalEList)getBooks()).basicRemove(otherEnd, msgs); + default: + return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); + } + } + return eBasicSetContainer(null, featureID, msgs); + } + + /** + * + * + * @generated + */ + public Object eGet(EStructuralFeature eFeature, boolean resolve) { + switch (eDerivedStructuralFeatureID(eFeature)) { + case LibraryPackage.WRITER__NAME: + return getName(); + case LibraryPackage.WRITER__BOOKS: + return getBooks(); + } + return eDynamicGet(eFeature, resolve); + } + + /** + * + * + * @generated + */ + public void eSet(EStructuralFeature eFeature, Object newValue) { + switch (eDerivedStructuralFeatureID(eFeature)) { + case LibraryPackage.WRITER__NAME: + setName((String)newValue); + return; + case LibraryPackage.WRITER__BOOKS: + getBooks().clear(); + getBooks().addAll((Collection)newValue); + return; + } + eDynamicSet(eFeature, newValue); + } + + /** + * + * + * @generated + */ + public void eUnset(EStructuralFeature eFeature) { + switch (eDerivedStructuralFeatureID(eFeature)) { + case LibraryPackage.WRITER__NAME: + setName(NAME_EDEFAULT); + return; + case LibraryPackage.WRITER__BOOKS: + getBooks().clear(); + return; + } + eDynamicUnset(eFeature); + } + + /** + * + * + * @generated + */ + public boolean eIsSet(EStructuralFeature eFeature) { + switch (eDerivedStructuralFeatureID(eFeature)) { + case LibraryPackage.WRITER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case LibraryPackage.WRITER__BOOKS: + return books != null && !books.isEmpty(); + } + return eDynamicIsSet(eFeature); + } + + /** + * + * + * @generated + */ + 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 Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryAdapterFactory.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryAdapterFactory.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryAdapterFactory.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryAdapterFactory.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,154 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.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.example.library.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.example.library.LibraryPackage + * @generated + */ +public class LibraryAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static LibraryPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public LibraryAdapterFactory() { + if (modelPackage == null) { + modelPackage = LibraryPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch the delegates to the createXXX methods. + * + * + * @generated + */ + protected LibrarySwitch modelSwitch = + new LibrarySwitch() { + public Object caseBook(Book object) { + return createBookAdapter(); + } + public Object caseLibrary(Library object) { + return createLibraryAdapter(); + } + public Object caseWriter(Writer object) { + return createWriterAdapter(); + } + public Object defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + public Adapter createAdapter(Notifier target) { + return (Adapter)modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.example.library.Book Book}'. + * + * 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. + * + * @return the new adapter. + * @see org.eclipse.example.library.Book + * @generated + */ + public Adapter createBookAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.example.library.Library Library}'. + * + * 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. + * + * @return the new adapter. + * @see org.eclipse.example.library.Library + * @generated + */ + public Adapter createLibraryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.example.library.Writer Writer}'. + * + * 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. + * + * @return the new adapter. + * @see org.eclipse.example.library.Writer + * @generated + */ + public Adapter createWriterAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //LibraryAdapterFactory Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceFactoryImpl.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceFactoryImpl.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceFactoryImpl.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceFactoryImpl.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,53 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.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; + +/** + * + * The Resource Factory associated with the package. + * + * @see org.eclipse.example.library.util.LibraryResourceImpl + * @generated + */ +public class LibraryResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * @generated + */ + public LibraryResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * @generated + */ + public Resource createResource(URI uri) { + XMLResource result = new LibraryResourceImpl(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.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); + return result; + } + +} //LibraryResourceFactoryImpl Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceImpl.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceImpl.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceImpl.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibraryResourceImpl.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,32 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.util; + +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * + * The Resource associated with the package. + * + * @see org.eclipse.example.library.util.LibraryResourceFactoryImpl + * @generated + */ +public class LibraryResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * + * + * @param uri the URI of the new resource. + * @generated + */ + public LibraryResourceImpl(URI uri) { + super(uri); + } + +} //LibraryResourceImpl Added: directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibrarySwitch.java URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibrarySwitch.java?view=auto&rev=482460 ============================================================================== --- directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibrarySwitch.java (added) +++ directory/sandbox/oersoy/library-maven/src/main/java/org/eclipse/example/library/util/LibrarySwitch.java Mon Dec 4 18:27:01 2006 @@ -0,0 +1,172 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.example.library.util; + +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.example.library.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX 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. + * + * @see org.eclipse.example.library.LibraryPackage + * @generated + */ +public class LibrarySwitch { + /** + * The cached model package + * + * + * @generated + */ + protected static LibraryPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public LibrarySwitch() { + if (modelPackage == null) { + modelPackage = LibraryPackage.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public Object doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected Object doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else { + List eSuperTypes = theEClass.getESuperTypes(); + return + eSuperTypes.isEmpty() ? + defaultCase(theEObject) : + doSwitch((EClass)eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected Object doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case LibraryPackage.BOOK: { + Book book = (Book)theEObject; + Object result = caseBook(book); + if (result == null) result = defaultCase(theEObject); + return result; + } + case LibraryPackage.LIBRARY: { + Library library = (Library)theEObject; + Object result = caseLibrary(library); + if (result == null) result = defaultCase(theEObject); + return result; + } + case LibraryPackage.WRITER: { + Writer writer = (Writer)theEObject; + Object result = caseWriter(writer); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpretting the object as an instance of 'Book'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpretting the object as an instance of 'Book'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseBook(Book object) { + return null; + } + + /** + * Returns the result of interpretting the object as an instance of 'Library'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpretting the object as an instance of 'Library'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseLibrary(Library object) { + return null; + } + + /** + * Returns the result of interpretting the object as an instance of 'Writer'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpretting the object as an instance of 'Writer'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public Object caseWriter(Writer object) { + return null; + } + + /** + * Returns the result of interpretting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpretting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public Object defaultCase(EObject object) { + return null; + } + +} //LibrarySwitch Added: directory/sandbox/oersoy/library-maven/target/classes/org/apache/App.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/apache/App.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/apache/App.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Book.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Book.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Book.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/BookCategory.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/BookCategory.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/BookCategory.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Library.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Library.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Library.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryFactory.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryFactory.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryFactory.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryPackage.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryPackage.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/LibraryPackage.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Writer.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Writer.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/Writer.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/BookImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/BookImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/BookImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryFactoryImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryFactoryImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryFactoryImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryPackageImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryPackageImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/LibraryPackageImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/WriterImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/WriterImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/impl/WriterImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory$1.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory%241.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory$1.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryAdapterFactory.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceFactoryImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceFactoryImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceFactoryImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceImpl.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceImpl.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibraryResourceImpl.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibrarySwitch.class URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibrarySwitch.class?view=auto&rev=482460 ============================================================================== Binary file - no diff available. Propchange: directory/sandbox/oersoy/library-maven/target/classes/org/eclipse/example/library/util/LibrarySwitch.class ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream