blob: 7b4f15006ef653ebfd89c42dedcbedea71711d25 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 2010 BMW Car IT, Technische Universitaet Muenchen, and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* BMW Car IT - Initial API and implementation
* Technische Universitaet Muenchen - Major refactoring and extension
*******************************************************************************/
package org.eclipse.emf.edapt.declaration.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.emf.edapt.declaration.Constraint;
import org.eclipse.emf.edapt.declaration.DeclarationFactory;
import org.eclipse.emf.edapt.declaration.DeclarationPackage;
import org.eclipse.emf.edapt.declaration.Library;
import org.eclipse.emf.edapt.declaration.Operation;
import org.eclipse.emf.edapt.declaration.Parameter;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
*
* @generated
*/
public class DeclarationFactoryImpl extends EFactoryImpl implements DeclarationFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public static DeclarationFactory init() {
try {
final DeclarationFactory theDeclarationFactory = (DeclarationFactory) EPackage.Registry.INSTANCE
.getEFactory("http://www.eclipse.org/emf/edapt/declaration/0.3"); //$NON-NLS-1$
if (theDeclarationFactory != null) {
return theDeclarationFactory;
}
} catch (final Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new DeclarationFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public DeclarationFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case DeclarationPackage.LIBRARY:
return createLibrary();
case DeclarationPackage.OPERATION:
return createOperation();
case DeclarationPackage.PARAMETER:
return createParameter();
case DeclarationPackage.CONSTRAINT:
return createConstraint();
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 Library createLibrary() {
final LibraryImpl library = new LibraryImpl();
return library;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Operation createOperation() {
final OperationImpl operation = new OperationImpl();
return operation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Parameter createParameter() {
final ParameterImpl parameter = new ParameterImpl();
return parameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Constraint createConstraint() {
final ConstraintImpl constraint = new ConstraintImpl();
return constraint;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public DeclarationPackage getDeclarationPackage() {
return (DeclarationPackage) getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @deprecated
* @generated
*/
@Deprecated
public static DeclarationPackage getPackage() {
return DeclarationPackage.eINSTANCE;
}
} // DeclarationFactoryImpl