| /** |
| * Copyright (c) 2013, 2017 CEA LIST. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| * |
| */ |
| package org.eclipse.papyrus.cdo.internal.core.repositories.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.papyrus.cdo.internal.core.repositories.RepositoriesFactory; |
| import org.eclipse.papyrus.cdo.internal.core.repositories.RepositoriesPackage; |
| import org.eclipse.papyrus.cdo.internal.core.repositories.Repository; |
| import org.eclipse.papyrus.cdo.internal.core.repositories.RepositoryRegistry; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public class RepositoriesFactoryImpl extends EFactoryImpl implements RepositoriesFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public static RepositoriesFactory init() { |
| try { |
| RepositoriesFactory theRepositoriesFactory = (RepositoriesFactory) EPackage.Registry.INSTANCE.getEFactory(RepositoriesPackage.eNS_URI); |
| if (theRepositoriesFactory != null) { |
| return theRepositoriesFactory; |
| } |
| } catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new RepositoriesFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public RepositoriesFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case RepositoriesPackage.REPOSITORY_REGISTRY: |
| return createRepositoryRegistry(); |
| case RepositoriesPackage.REPOSITORY: |
| return createRepository(); |
| default: |
| throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public RepositoryRegistry createRepositoryRegistry() { |
| RepositoryRegistryImpl repositoryRegistry = new RepositoryRegistryImpl(); |
| return repositoryRegistry; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Repository createRepository() { |
| RepositoryImpl repository = new RepositoryImpl(); |
| return repository; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public RepositoriesPackage getRepositoriesPackage() { |
| return (RepositoriesPackage) getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static RepositoriesPackage getPackage() { |
| return RepositoriesPackage.eINSTANCE; |
| } |
| |
| } // RepositoriesFactoryImpl |