/** | |
* Copyright (c) 2020 RBEI and others. | |
* | |
* This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v. 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: | |
* Adhith Gopal - Initial API and Implementation | |
* | |
*/ | |
package org.eclipse.blockchain.model.ethproject.impl; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
import org.eclipse.blockchain.model.ethproject.*; | |
import org.eclipse.core.resources.IProject; | |
import org.eclipse.core.resources.IProjectDescription; | |
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; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model <b>Factory</b>. | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public class EthprojectFactoryImpl extends EFactoryImpl implements EthprojectFactory { | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static final String copyright = "Copyright (c) 2020 RBEI and others.\n\nThis program and the accompanying materials\nare made available under the terms of the Eclipse Public License v. 2.0\nwhich accompanies this distribution, and is available at\nhttps://www.eclipse.org/legal/epl-2.0/\n\nSPDX-License-Identifier: EPL-2.0\n\nContributors:\n Adhith Gopal - Initial API and Implementation\n "; | |
/** | |
* Creates the default factory implementation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static EthprojectFactory init() { | |
try { | |
EthprojectFactory theEthprojectFactory = (EthprojectFactory) EPackage.Registry.INSTANCE | |
.getEFactory(EthprojectPackage.eNS_URI); | |
if (theEthprojectFactory != null) { | |
return theEthprojectFactory; | |
} | |
} catch (Exception exception) { | |
EcorePlugin.INSTANCE.log(exception); | |
} | |
return new EthprojectFactoryImpl(); | |
} | |
/** | |
* Creates an instance of the factory. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EthprojectFactoryImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EObject create(EClass eClass) { | |
switch (eClass.getClassifierID()) { | |
case EthprojectPackage.DEPLOYMENT_MODEL: | |
return createDeploymentModel(); | |
case EthprojectPackage.ETHEREUM_PROJECT: | |
return createEthereumProject(); | |
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 EthprojectPackage.IPROJECT_DESCRIPTION: | |
return createIProjectDescriptionFromString(eDataType, initialValue); | |
case EthprojectPackage.IPROJECT: | |
return createIProjectFromString(eDataType, initialValue); | |
case EthprojectPackage.STRING_LIST: | |
return createstringListFromString(eDataType, initialValue); | |
case EthprojectPackage.IRESOURCE_SET: | |
return createIResourceSetFromString(eDataType, initialValue); | |
case EthprojectPackage.DEPLOYMENT_MAP: | |
return createDeploymentMapFromString(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 EthprojectPackage.IPROJECT_DESCRIPTION: | |
return convertIProjectDescriptionToString(eDataType, instanceValue); | |
case EthprojectPackage.IPROJECT: | |
return convertIProjectToString(eDataType, instanceValue); | |
case EthprojectPackage.STRING_LIST: | |
return convertstringListToString(eDataType, instanceValue); | |
case EthprojectPackage.IRESOURCE_SET: | |
return convertIResourceSetToString(eDataType, instanceValue); | |
case EthprojectPackage.DEPLOYMENT_MAP: | |
return convertDeploymentMapToString(eDataType, instanceValue); | |
default: | |
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); | |
} | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public DeploymentModel createDeploymentModel() { | |
DeploymentModelImpl deploymentModel = new DeploymentModelImpl(); | |
return deploymentModel; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EthereumProject createEthereumProject() { | |
EthereumProjectImpl ethereumProject = new EthereumProjectImpl(); | |
return ethereumProject; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IProjectDescription createIProjectDescriptionFromString(EDataType eDataType, String initialValue) { | |
return (IProjectDescription) super.createFromString(eDataType, initialValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertIProjectDescriptionToString(EDataType eDataType, Object instanceValue) { | |
return super.convertToString(eDataType, instanceValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IProject createIProjectFromString(EDataType eDataType, String initialValue) { | |
return (IProject) super.createFromString(eDataType, initialValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertIProjectToString(EDataType eDataType, Object instanceValue) { | |
return super.convertToString(eDataType, instanceValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
public List<String> createstringListFromString(EDataType eDataType, String initialValue) { | |
return (List<String>) super.createFromString(initialValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertstringListToString(EDataType eDataType, Object instanceValue) { | |
return super.convertToString(instanceValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
public Set<String> createIResourceSetFromString(EDataType eDataType, String initialValue) { | |
return (Set<String>) super.createFromString(initialValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertIResourceSetToString(EDataType eDataType, Object instanceValue) { | |
return super.convertToString(instanceValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
public Map<String, Map<String, DeploymentModel>> createDeploymentMapFromString(EDataType eDataType, | |
String initialValue) { | |
return (Map<String, Map<String, DeploymentModel>>) super.createFromString(initialValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String convertDeploymentMapToString(EDataType eDataType, Object instanceValue) { | |
return super.convertToString(instanceValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EthprojectPackage getEthprojectPackage() { | |
return (EthprojectPackage) getEPackage(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @deprecated | |
* @generated | |
*/ | |
@Deprecated | |
public static EthprojectPackage getPackage() { | |
return EthprojectPackage.eINSTANCE; | |
} | |
} //EthprojectFactoryImpl |