blob: d2e2a45244f99d3fc45ee5d8d3c190e4119e2d6d [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.internal.client.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.ResAuthApplicationType;
import org.eclipse.jst.j2ee.internal.client.ClientPackage;
/**
* @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:
return ResAuthApplicationType.get(initialValue);
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;
}
}