blob: d9e6ba91f5f564df0971ddd5bdde9f3e0986a1ba [file] [log] [blame]
/*
* Copyright (c) 2010-2012, 2014 Eike Stepper (Berlin, Germany) 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:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.emf.cdo.etypes.impl;
import org.eclipse.emf.cdo.common.lob.CDOLob;
import org.eclipse.emf.cdo.etypes.Annotation;
import org.eclipse.emf.cdo.etypes.EtypesFactory;
import org.eclipse.emf.cdo.etypes.EtypesPackage;
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>.
*
* @since 4.0
* @noextend This interface is not intended to be extended by clients. <!-- end-user-doc -->
* @generated
*/
public class EtypesFactoryImpl extends EFactoryImpl implements EtypesFactory
{
/**
* Creates the default factory implementation.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public static EtypesFactory init()
{
try
{
EtypesFactory theEtypesFactory = (EtypesFactory)EPackage.Registry.INSTANCE.getEFactory(EtypesPackage.eNS_URI);
if (theEtypesFactory != null)
{
return theEtypesFactory;
}
}
catch (Exception exception)
{
EcorePlugin.INSTANCE.log(exception);
}
return new EtypesFactoryImpl();
}
/**
* Creates an instance of the factory.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public EtypesFactoryImpl()
{
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public EObject create(EClass eClass)
{
switch (eClass.getClassifierID())
{
case EtypesPackage.ANNOTATION:
return createAnnotation();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public Object createFromString(EDataType eDataType, String initialValue)
{
switch (eDataType.getClassifierID())
{
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public String convertToString(EDataType eDataType, Object instanceValue)
{
switch (eDataType.getClassifierID())
{
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public Annotation createAnnotation()
{
AnnotationImpl annotation = new AnnotationImpl();
return annotation;
}
/**
* <!-- begin-user-doc -->
*
* @since 4.1 <!-- end-user-doc -->
* @generated NOT
*/
public CDOLob<?> createLobFromString(EDataType eDataType, String initialValue)
{
return (CDOLob<?>)super.createFromString(eDataType, initialValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public EtypesPackage getEtypesPackage()
{
return (EtypesPackage)getEPackage();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @deprecated
* @generated
*/
@Deprecated
public static EtypesPackage getPackage()
{
return EtypesPackage.eINSTANCE;
}
} // EtypesFactoryImpl