| /******************************************************************************* |
| * Copyright (c) 2011 Red Hat, Inc. |
| * All rights reserved. |
| * This program is 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: |
| * Red Hat, Inc. - initial API and implementation |
| * |
| * @author Bob Brodt |
| ******************************************************************************/ |
| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id$ |
| */ |
| package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.impl; |
| |
| import java.math.BigInteger; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.*; |
| |
| 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.impl.EFactoryImpl; |
| |
| import org.eclipse.emf.ecore.plugin.EcorePlugin; |
| import org.eclipse.emf.ecore.xml.type.XMLTypeFactory; |
| import org.eclipse.emf.ecore.xml.type.XMLTypePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model <b>Factory</b>. |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public class ModelFactoryImpl extends EFactoryImpl implements ModelFactory { |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ModelFactory init() { |
| try { |
| ModelFactory theModelFactory = (ModelFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.drools.com"); |
| if (theModelFactory != null) { |
| return theModelFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new ModelFactoryImpl(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ModelFactoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case ModelPackage.DOCUMENT_ROOT: return createDocumentRoot(); |
| case ModelPackage.GLOBAL_TYPE: return createGlobalType(); |
| case ModelPackage.IMPORT_TYPE: return createImportType(); |
| case ModelPackage.ON_ENTRY_SCRIPT_TYPE: return createOnEntryScriptType(); |
| case ModelPackage.ON_EXIT_SCRIPT_TYPE: return createOnExitScriptType(); |
| case ModelPackage.TASK: return createTask(); |
| case ModelPackage.PARAMETER: return createParameter(); |
| 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 ModelPackage.PACKAGE_NAME_TYPE: |
| return createPackageNameTypeFromString(eDataType, initialValue); |
| case ModelPackage.PRIORITY_TYPE: |
| return createPriorityTypeFromString(eDataType, initialValue); |
| case ModelPackage.RULE_FLOW_GROUP_TYPE: |
| return createRuleFlowGroupTypeFromString(eDataType, initialValue); |
| case ModelPackage.TASK_NAME_TYPE: |
| return createTaskNameTypeFromString(eDataType, initialValue); |
| case ModelPackage.VERSION_TYPE: |
| return createVersionTypeFromString(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 ModelPackage.PACKAGE_NAME_TYPE: |
| return convertPackageNameTypeToString(eDataType, instanceValue); |
| case ModelPackage.PRIORITY_TYPE: |
| return convertPriorityTypeToString(eDataType, instanceValue); |
| case ModelPackage.RULE_FLOW_GROUP_TYPE: |
| return convertRuleFlowGroupTypeToString(eDataType, instanceValue); |
| case ModelPackage.TASK_NAME_TYPE: |
| return convertTaskNameTypeToString(eDataType, instanceValue); |
| case ModelPackage.VERSION_TYPE: |
| return convertVersionTypeToString(eDataType, instanceValue); |
| default: |
| throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DocumentRoot createDocumentRoot() { |
| DocumentRootImpl documentRoot = new DocumentRootImpl(); |
| return documentRoot; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public GlobalType createGlobalType() { |
| GlobalTypeImpl globalType = new GlobalTypeImpl(); |
| return globalType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ImportType createImportType() { |
| ImportTypeImpl importType = new ImportTypeImpl(); |
| return importType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OnEntryScriptType createOnEntryScriptType() { |
| OnEntryScriptTypeImpl onEntryScriptType = new OnEntryScriptTypeImpl(); |
| return onEntryScriptType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OnExitScriptType createOnExitScriptType() { |
| OnExitScriptTypeImpl onExitScriptType = new OnExitScriptTypeImpl(); |
| return onExitScriptType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Task createTask() { |
| TaskImpl task = new TaskImpl(); |
| return task; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Parameter createParameter() { |
| ParameterImpl parameter = new ParameterImpl(); |
| return parameter; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String createPackageNameTypeFromString(EDataType eDataType, String initialValue) { |
| return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertPackageNameTypeToString(EDataType eDataType, Object instanceValue) { |
| return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BigInteger createPriorityTypeFromString(EDataType eDataType, String initialValue) { |
| return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertPriorityTypeToString(EDataType eDataType, Object instanceValue) { |
| return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String createRuleFlowGroupTypeFromString(EDataType eDataType, String initialValue) { |
| return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertRuleFlowGroupTypeToString(EDataType eDataType, Object instanceValue) { |
| return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String createTaskNameTypeFromString(EDataType eDataType, String initialValue) { |
| return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertTaskNameTypeToString(EDataType eDataType, Object instanceValue) { |
| return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public BigInteger createVersionTypeFromString(EDataType eDataType, String initialValue) { |
| return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertVersionTypeToString(EDataType eDataType, Object instanceValue) { |
| return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ModelPackage getModelPackage() { |
| return (ModelPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static ModelPackage getPackage() { |
| return ModelPackage.eINSTANCE; |
| } |
| |
| } //ModelFactoryImpl |