blob: 6b1ad79a46923e7890edd588bd684c034f6b0554 [file] [log] [blame]
/**
* Copyright (c) 2017 Christian W. Damus and others.
*
* 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:
* Christian W. Damus - initial API and implementation
*
*/
package org.eclipse.papyrus.compare.uml2.tests.blocks.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.compare.uml2.tests.blocks.*;
/**
* <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc -->
*
* @generated
*/
public class BlocksFactoryImpl extends EFactoryImpl implements BlocksFactory {
/**
* Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public static BlocksFactory init() {
try {
BlocksFactory theBlocksFactory = (BlocksFactory)EPackage.Registry.INSTANCE
.getEFactory(BlocksPackage.eNS_URI);
if (theBlocksFactory != null) {
return theBlocksFactory;
}
} catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new BlocksFactoryImpl();
}
/**
* Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public BlocksFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case BlocksPackage.BLOCK:
return createBlock();
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 Block createBlock() {
BlockImpl block = new BlockImpl();
return block;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public BlocksPackage getBlocksPackage() {
return (BlocksPackage)getEPackage();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @deprecated
* @generated
*/
@Deprecated
public static BlocksPackage getPackage() {
return BlocksPackage.eINSTANCE;
}
} // BlocksFactoryImpl