blob: 7144398d167faa9876867cfb122e939f9dec03af [file] [log] [blame]
/**
* Copyright (c) 2014,2016 Loetz GmbH&Co.KG (Heidelberg)
* 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:
* Loetz GmbH&Co.KG - Initial implementation
*
*/
package org.eclipse.osbp.xtext.menu.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.osbp.xtext.menu.*;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Factory</b>.
* <!-- end-user-doc -->
* @generated
*/
public class MenuDslFactoryImpl extends EFactoryImpl implements MenuDslFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static MenuDslFactory init() {
try {
MenuDslFactory theMenuDslFactory = (MenuDslFactory)EPackage.Registry.INSTANCE.getEFactory(MenuDslPackage.eNS_URI);
if (theMenuDslFactory != null) {
return theMenuDslFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
return new MenuDslFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuDslFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case MenuDslPackage.MENU_MODEL: return createMenuModel();
case MenuDslPackage.MENU_PACKAGE: return createMenuPackage();
case MenuDslPackage.MENU_CATEGORY: return createMenuCategory();
case MenuDslPackage.MENU_TREE: return createMenuTree();
case MenuDslPackage.MENU_ENTRY: return createMenuEntry();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case MenuDslPackage.INTERNAL_EOBJECT:
return createInternalEObjectFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case MenuDslPackage.INTERNAL_EOBJECT:
return convertInternalEObjectToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuModel createMenuModel() {
MenuModelImpl menuModel = new MenuModelImpl();
return menuModel;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuPackage createMenuPackage() {
MenuPackageImpl menuPackage = new MenuPackageImpl();
return menuPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuCategory createMenuCategory() {
MenuCategoryImpl menuCategory = new MenuCategoryImpl();
return menuCategory;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuTree createMenuTree() {
MenuTreeImpl menuTree = new MenuTreeImpl();
return menuTree;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuEntry createMenuEntry() {
MenuEntryImpl menuEntry = new MenuEntryImpl();
return menuEntry;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InternalEObject createInternalEObjectFromString(EDataType eDataType, String initialValue) {
return (InternalEObject)super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertInternalEObjectToString(EDataType eDataType, Object instanceValue) {
return super.convertToString(eDataType, instanceValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MenuDslPackage getMenuDslPackage() {
return (MenuDslPackage)getEPackage();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static MenuDslPackage getPackage() {
return MenuDslPackage.eINSTANCE;
}
} //MenuDslFactoryImpl