package org.eclipse.modisco.kdm; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.texo.model.AbstractModelFeatureMapEntry; import org.eclipse.emf.texo.model.ModelFactory; import org.eclipse.emf.texo.model.ModelFeatureMapEntry; import org.eclipse.emf.texo.model.ModelObject; /** * The <b>{@link ModelFactory}</b> for the types of this model: kdm. It contains code to create instances * {@link ModelObject} wrappers and instances for EClasses and convert objects back and forth from their String (XML) * representation. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public class KdmModelFactory implements ModelFactory { /** * Creates an instance for an {@link EClass} <!-- begin-user-doc --> <!-- end-user-doc --> * * @param eClass * creates a Object instance for this EClass * @return an object representing the eClass * @generated */ public Object create(EClass eClass) { switch (eClass.getClassifierID()) { default: throw new IllegalArgumentException("The EClass '" + eClass.getName() + "' is not a valid EClass for this EPackage"); } } /** * Wraps an object in a {@link ModelObject}. <!-- begin-user-doc --> <!-- end-user-doc --> * * @param eClass * the EClass of the object * @param adaptee * the object being wrapped/adapted * @return the wrapper {@link ModelObject} * @generated */ @SuppressWarnings({ "unchecked", "rawtypes" }) public <T> ModelObject<T> createModelObject(EClass eClass, T adaptee) { throw new IllegalArgumentException("The EClass '" + eClass + "' is not defined in this EPackage"); } /** * Creates a feature map entry instance for a certain EStructuralFeature. * * @param eFeature * the feature map feature * @return the pojo feature map entry * @generated */ public Object createFeatureMapEntry(EStructuralFeature eFeature) { throw new IllegalArgumentException("The EStructuralFeature '" + eFeature + "' is not a valid feature map in this EPackage"); } /** * Wraps a feature map entry pojo in a {@link AbstractModelFeatureMapEntry}. If the feature map entry is null then a * new one is created and <!-- begin-user-doc --> <!-- end-user-doc --> * * @param eFeature * the feature map feature of the object * @param adaptee * the pojo feature map entry being wrapped/adapted * @return the wrapper {@link ModelFeatureMapEntry} * @generated */ public ModelFeatureMapEntry<?> createModelFeatureMapEntry(EStructuralFeature eFeature, Object adaptee) { throw new IllegalArgumentException("The EStructuralFeature '" + eFeature + "' is not a valid feature map in this EPackage"); } /** * Converts an instance of an {@link EDataType} to a String. <!-- begin-user-doc --> <!-- end-user-doc --> * * @param eDataType * the {@link EDataType} defining the type * @param value * the object to convert, if the value is null then null is returned. * @generated */ public Object createFromString(EDataType eDataType, String value) { switch (eDataType.getClassifierID()) { default: throw new IllegalArgumentException("The EDatatype '" + eDataType + "' is not defined in this EPackage"); } } /** * Converts an instance of an {@link EDataType} to a String. <!-- begin-user-doc --> <!-- end-user-doc --> * * @param eDataType * the {@link EDataType} defining the type * @param value * the object to convert, if value == null then null is returned * @generated */ public String convertToString(EDataType eDataType, Object value) { switch (eDataType.getClassifierID()) { default: throw new IllegalArgumentException("The EDatatype '" + eDataType + "' is not defined in this EPackage."); } } }