blob: 842fd08380ee6e4b31068094407d81eeba94bb7b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2001, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are 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:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jst.j2ee.client.internal.impl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.jst.j2ee.client.ApplicationClient;
import org.eclipse.jst.j2ee.client.ClientFactory;
import org.eclipse.jst.j2ee.client.ClientPackage;
import org.eclipse.jst.j2ee.client.ResAuthApplicationType;
/**
* @generated
*/
public class ClientFactoryImpl extends EFactoryImpl implements ClientFactory{
public ClientFactoryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case ClientPackage.APPLICATION_CLIENT: return createApplicationClient();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
case ClientPackage.RES_AUTH_APPLICATION_TYPE: {
ResAuthApplicationType result = ResAuthApplicationType.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
}
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
case ClientPackage.RES_AUTH_APPLICATION_TYPE:
return instanceValue == null ? null : instanceValue.toString();
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
}
public static ClientFactory getActiveFactory() {
return (ClientFactory) getPackage().getEFactoryInstance();
}
/**
* @generated This field/method will be replaced during code generation.
*/
public ApplicationClient createApplicationClient() {
ApplicationClientImpl applicationClient = new ApplicationClientImpl();
return applicationClient;
}
/**
* @generated This field/method will be replaced during code generation.
*/
public ClientPackage getClientPackage() {
return (ClientPackage)getEPackage();
}
/**
* @generated This field/method will be replaced during code generation.
*/
public static ClientPackage getPackage() {
return ClientPackage.eINSTANCE;
}
}