/** * <copyright> * </copyright> * * $Id: LibraryFactoryImpl.java,v 1.2 2007/02/22 21:48:18 ahunter Exp $ */ package org.eclipse.gmf.examples.eclipsecon.library.impl; import org.eclipse.emf.ecore.EClass; 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.gmf.examples.eclipsecon.library.*; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class LibraryFactoryImpl extends EFactoryImpl implements LibraryFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static LibraryFactory init() { try { LibraryFactory theLibraryFactory = (LibraryFactory)EPackage.Registry.INSTANCE.getEFactory("http:///org/eclipse/gmf/examples/library.ecore"); if (theLibraryFactory != null) { return theLibraryFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new LibraryFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LibraryFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case LibraryPackage.AUTHOR: return createAuthor(); case LibraryPackage.BOOK: return createBook(); case LibraryPackage.EMPLOYEE: return createEmployee(); case LibraryPackage.LIBRARY: return createLibrary(); case LibraryPackage.SHELF: return createShelf(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Author createAuthor() { AuthorImpl author = new AuthorImpl(); return author; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Book createBook() { BookImpl book = new BookImpl(); return book; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Employee createEmployee() { EmployeeImpl employee = new EmployeeImpl(); return employee; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Library createLibrary() { LibraryImpl library = new LibraryImpl(); return library; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Shelf createShelf() { ShelfImpl shelf = new ShelfImpl(); return shelf; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LibraryPackage getLibraryPackage() { return (LibraryPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ public static LibraryPackage getPackage() { return LibraryPackage.eINSTANCE; } } //LibraryFactoryImpl