| /******************************************************************************* |
| * Copyright (c) 2014 E.D.Willink 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: |
| * E.D.Willink - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.ocl.examples.library.oclstdlib; |
| |
| import java.util.Collection; |
| import java.util.List; |
| import java.util.Set; |
| |
| 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; |
| import org.eclipse.ocl.examples.domain.values.Bag; |
| import org.eclipse.ocl.examples.domain.values.IntegerValue; |
| import org.eclipse.ocl.examples.domain.values.OrderedSet; |
| import org.eclipse.ocl.examples.domain.values.RealValue; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * The <b>Factory</b> for the model. |
| * It provides a create method for each non-abstract class of the model. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.ocl.examples.library.oclstdlib.OCLstdlibPackage |
| * @generated |
| */ |
| public class OCLstdlibFactory extends EFactoryImpl { |
| /** |
| * The singleton instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final OCLstdlibFactory eINSTANCE = init(); |
| |
| /** |
| * Creates the default factory implementation. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static OCLstdlibFactory init() { |
| try { |
| OCLstdlibFactory theOCLstdlibFactory = (OCLstdlibFactory)EPackage.Registry.INSTANCE.getEFactory(OCLstdlibPackage.eNS_URI); |
| if (theOCLstdlibFactory != null) { |
| return theOCLstdlibFactory; |
| } |
| } |
| catch (Exception exception) { |
| EcorePlugin.INSTANCE.log(exception); |
| } |
| return new OCLstdlibFactory(); |
| } |
| |
| /** |
| * Creates an instance of the factory. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OCLstdlibFactory() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EObject create(EClass eClass) { |
| switch (eClass.getClassifierID()) { |
| case OCLstdlibPackage.OCL_INVALID: return createOclInvalid(); |
| case OCLstdlibPackage.OCL_VOID: return createOclVoid(); |
| 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()) { |
| case OCLstdlibPackage.BOOLEAN: |
| return createBooleanFromString(eDataType, initialValue); |
| case OCLstdlibPackage.INTEGER: |
| return createIntegerFromString(eDataType, initialValue); |
| case OCLstdlibPackage.REAL: |
| return createRealFromString(eDataType, initialValue); |
| case OCLstdlibPackage.STRING: |
| return createStringFromString(eDataType, initialValue); |
| case OCLstdlibPackage.UNLIMITED_NATURAL: |
| return createUnlimitedNaturalFromString(eDataType, initialValue); |
| case OCLstdlibPackage.BAG: |
| return createBagFromString(eDataType, initialValue); |
| case OCLstdlibPackage.COLLECTION: |
| return createCollectionFromString(eDataType, initialValue); |
| case OCLstdlibPackage.ORDERED_SET: |
| return createOrderedSetFromString(eDataType, initialValue); |
| case OCLstdlibPackage.SEQUENCE: |
| return createSequenceFromString(eDataType, initialValue); |
| case OCLstdlibPackage.SET: |
| return createSetFromString(eDataType, initialValue); |
| case OCLstdlibPackage.UNIQUE_COLLECTION: |
| return createUniqueCollectionFromString(eDataType, initialValue); |
| case OCLstdlibPackage.OCL_ANY: |
| return createOclAnyFromString(eDataType, initialValue); |
| 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()) { |
| case OCLstdlibPackage.BOOLEAN: |
| return convertBooleanToString(eDataType, instanceValue); |
| case OCLstdlibPackage.INTEGER: |
| return convertIntegerToString(eDataType, instanceValue); |
| case OCLstdlibPackage.REAL: |
| return convertRealToString(eDataType, instanceValue); |
| case OCLstdlibPackage.STRING: |
| return convertStringToString(eDataType, instanceValue); |
| case OCLstdlibPackage.UNLIMITED_NATURAL: |
| return convertUnlimitedNaturalToString(eDataType, instanceValue); |
| case OCLstdlibPackage.BAG: |
| return convertBagToString(eDataType, instanceValue); |
| case OCLstdlibPackage.COLLECTION: |
| return convertCollectionToString(eDataType, instanceValue); |
| case OCLstdlibPackage.ORDERED_SET: |
| return convertOrderedSetToString(eDataType, instanceValue); |
| case OCLstdlibPackage.SEQUENCE: |
| return convertSequenceToString(eDataType, instanceValue); |
| case OCLstdlibPackage.SET: |
| return convertSetToString(eDataType, instanceValue); |
| case OCLstdlibPackage.UNIQUE_COLLECTION: |
| return convertUniqueCollectionToString(eDataType, instanceValue); |
| case OCLstdlibPackage.OCL_ANY: |
| return convertOclAnyToString(eDataType, instanceValue); |
| 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 OclInvalid createOclInvalid() { |
| OclInvalid oclInvalid = new OclInvalid(); |
| return oclInvalid; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OclVoid createOclVoid() { |
| OclVoid oclVoid = new OclVoid(); |
| return oclVoid; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Boolean createBooleanFromString(EDataType eDataType, String initialValue) { |
| return (Boolean)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertBooleanToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IntegerValue createIntegerFromString(EDataType eDataType, String initialValue) { |
| return (IntegerValue)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertIntegerToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public RealValue createRealFromString(EDataType eDataType, String initialValue) { |
| return (RealValue)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertRealToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String createStringFromString(EDataType eDataType, String initialValue) { |
| return (String)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertStringToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IntegerValue createUnlimitedNaturalFromString(EDataType eDataType, String initialValue) { |
| return (IntegerValue)super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertUnlimitedNaturalToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Bag<?> createBagFromString(EDataType eDataType, String initialValue) { |
| return (Bag<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertBagToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Collection<?> createCollectionFromString(EDataType eDataType, String initialValue) { |
| return (Collection<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertCollectionToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OrderedSet<?> createOrderedSetFromString(EDataType eDataType, String initialValue) { |
| return (OrderedSet<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertOrderedSetToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public List<?> createSequenceFromString(EDataType eDataType, String initialValue) { |
| return (List<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertSequenceToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Set<?> createSetFromString(EDataType eDataType, String initialValue) { |
| return (Set<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertSetToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Set<?> createUniqueCollectionFromString(EDataType eDataType, String initialValue) { |
| return (Set<?>)super.createFromString(initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertUniqueCollectionToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object createOclAnyFromString(EDataType eDataType, String initialValue) { |
| return super.createFromString(eDataType, initialValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String convertOclAnyToString(EDataType eDataType, Object instanceValue) { |
| return super.convertToString(eDataType, instanceValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OCLstdlibPackage getOCLstdlibPackage() { |
| return (OCLstdlibPackage)getEPackage(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @deprecated |
| * @generated |
| */ |
| @Deprecated |
| public static OCLstdlibPackage getPackage() { |
| return OCLstdlibPackage.eINSTANCE; |
| } |
| |
| } //OCLstdlibFactory |