All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.drools.impl.DroolsFactoryImpl Maven / Gradle / Ivy

There is a newer version: 7.54.0.Final
Show newest version
/**
 */
package org.jboss.drools.impl;

import java.math.BigInteger;

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;

import org.jboss.drools.*;

/**
 * 
 * An implementation of the model Factory.
 * 
 * @generated
 */
public class DroolsFactoryImpl extends EFactoryImpl implements DroolsFactory {
	/**
	 * Creates the default factory implementation.
	 * 
	 * 
	 * @generated
	 */
	public static DroolsFactory init() {
		try {
			DroolsFactory theDroolsFactory = (DroolsFactory)EPackage.Registry.INSTANCE.getEFactory(DroolsPackage.eNS_URI);
			if (theDroolsFactory != null) {
				return theDroolsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new DroolsFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * 
	 * 
	 * @generated
	 */
	public DroolsFactoryImpl() {
		super();
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case DroolsPackage.DOCUMENT_ROOT: return createDocumentRoot();
			case DroolsPackage.GLOBAL_TYPE: return createGlobalType();
			case DroolsPackage.IMPORT_TYPE: return createImportType();
			case DroolsPackage.META_DATA_TYPE: return createMetaDataType();
			case DroolsPackage.ON_ENTRY_SCRIPT_TYPE: return createOnEntryScriptType();
			case DroolsPackage.ON_EXIT_SCRIPT_TYPE: return createOnExitScriptType();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case DroolsPackage.PACKAGE_NAME_TYPE:
				return createPackageNameTypeFromString(eDataType, initialValue);
			case DroolsPackage.PRIORITY_TYPE:
				return createPriorityTypeFromString(eDataType, initialValue);
			case DroolsPackage.RULE_FLOW_GROUP_TYPE:
				return createRuleFlowGroupTypeFromString(eDataType, initialValue);
			case DroolsPackage.TASK_NAME_TYPE:
				return createTaskNameTypeFromString(eDataType, initialValue);
			case DroolsPackage.VERSION_TYPE:
				return createVersionTypeFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case DroolsPackage.PACKAGE_NAME_TYPE:
				return convertPackageNameTypeToString(eDataType, instanceValue);
			case DroolsPackage.PRIORITY_TYPE:
				return convertPriorityTypeToString(eDataType, instanceValue);
			case DroolsPackage.RULE_FLOW_GROUP_TYPE:
				return convertRuleFlowGroupTypeToString(eDataType, instanceValue);
			case DroolsPackage.TASK_NAME_TYPE:
				return convertTaskNameTypeToString(eDataType, instanceValue);
			case DroolsPackage.VERSION_TYPE:
				return convertVersionTypeToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public DocumentRoot createDocumentRoot() {
		DocumentRootImpl documentRoot = new DocumentRootImpl();
		return documentRoot;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public GlobalType createGlobalType() {
		GlobalTypeImpl globalType = new GlobalTypeImpl();
		return globalType;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public ImportType createImportType() {
		ImportTypeImpl importType = new ImportTypeImpl();
		return importType;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public MetaDataType createMetaDataType() {
		MetaDataTypeImpl metaDataType = new MetaDataTypeImpl();
		return metaDataType;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public OnEntryScriptType createOnEntryScriptType() {
		OnEntryScriptTypeImpl onEntryScriptType = new OnEntryScriptTypeImpl();
		return onEntryScriptType;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public OnExitScriptType createOnExitScriptType() {
		OnExitScriptTypeImpl onExitScriptType = new OnExitScriptTypeImpl();
		return onExitScriptType;
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String createPackageNameTypeFromString(EDataType eDataType, String initialValue) {
		return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String convertPackageNameTypeToString(EDataType eDataType, Object instanceValue) {
		return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public BigInteger createPriorityTypeFromString(EDataType eDataType, String initialValue) {
		return (BigInteger)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.INTEGER, initialValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String convertPriorityTypeToString(EDataType eDataType, Object instanceValue) {
		return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.INTEGER, instanceValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String createRuleFlowGroupTypeFromString(EDataType eDataType, String initialValue) {
		return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String convertRuleFlowGroupTypeToString(EDataType eDataType, Object instanceValue) {
		return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String createTaskNameTypeFromString(EDataType eDataType, String initialValue) {
		return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String convertTaskNameTypeToString(EDataType eDataType, Object instanceValue) {
		return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String createVersionTypeFromString(EDataType eDataType, String initialValue) {
		return (String)XMLTypeFactory.eINSTANCE.createFromString(XMLTypePackage.Literals.STRING, initialValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	public String convertVersionTypeToString(EDataType eDataType, Object instanceValue) {
		return XMLTypeFactory.eINSTANCE.convertToString(XMLTypePackage.Literals.STRING, instanceValue);
	}

	/**
	 * 
	 * 
	 * @generated
	 */
	@Override
	public DroolsPackage getDroolsPackage() {
		return (DroolsPackage)getEPackage();
	}

	/**
	 * 
	 * 
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static DroolsPackage getPackage() {
		return DroolsPackage.eINSTANCE;
	}

} //DroolsFactoryImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy