diff options
Diffstat (limited to 'examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util')
5 files changed, 0 insertions, 550 deletions
diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogAdapterFactory.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogAdapterFactory.java deleted file mode 100644 index d2739a133..000000000 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogAdapterFactory.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id: CatalogAdapterFactory.java,v 1.2 2007/02/08 23:09:25 mtaal Exp $ - */ -package org.eclipse.emf.teneo.samples.emf.sample.catalog.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; - -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.emf.teneo.samples.emf.sample.catalog.*; - -/** - * <!-- begin-user-doc --> - * The <b>Adapter Factory</b> for the model. - * It provides an adapter <code>createXXX</code> method for each class of the model. - * <!-- end-user-doc --> - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.CatalogPackage - * @generated - */ -public class CatalogAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected static CatalogPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CatalogAdapterFactory() { - if (modelPackage == null) { - modelPackage = CatalogPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * <!-- begin-user-doc --> - * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. - * <!-- end-user-doc --> - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch the delegates to the <code>createXXX</code> methods. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected CatalogSwitch<Adapter> modelSwitch = - new CatalogSwitch<Adapter>() { - @Override - public Adapter caseCatalogType(CatalogType object) { - return createCatalogTypeAdapter(); - } - @Override - public Adapter casePriceType(PriceType object) { - return createPriceTypeAdapter(); - } - @Override - public Adapter caseProductType(ProductType object) { - return createProductTypeAdapter(); - } - @Override - public Adapter caseStringType(StringType object) { - return createStringTypeAdapter(); - } - @Override - public Adapter caseSupplierType(SupplierType object) { - return createSupplierTypeAdapter(); - } - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the <code>target</code>. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param target the object to adapt. - * @return the adapter for the <code>target</code>. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.sample.catalog.CatalogType <em>Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.CatalogType - * @generated - */ - public Adapter createCatalogTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.sample.catalog.PriceType <em>Price Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.PriceType - * @generated - */ - public Adapter createPriceTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.sample.catalog.ProductType <em>Product Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.ProductType - * @generated - */ - public Adapter createProductTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.sample.catalog.StringType <em>String Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.StringType - * @generated - */ - public Adapter createStringTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.sample.catalog.SupplierType <em>Supplier Type</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.SupplierType - * @generated - */ - public Adapter createSupplierTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * <!-- begin-user-doc --> - * This default implementation returns null. - * <!-- end-user-doc --> - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} //CatalogAdapterFactory diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceFactoryImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceFactoryImpl.java deleted file mode 100644 index 8740628a1..000000000 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceFactoryImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id: CatalogResourceFactoryImpl.java,v 1.2 2007/02/08 23:09:25 mtaal Exp $ - */ -package org.eclipse.emf.teneo.samples.emf.sample.catalog.util; - -import org.eclipse.emf.common.util.URI; - -import org.eclipse.emf.ecore.resource.Resource; - -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; - -import org.eclipse.emf.ecore.xmi.XMLResource; - -/** - * <!-- begin-user-doc --> - * The <b>Resource Factory</b> associated with the package. - * <!-- end-user-doc --> - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.util.CatalogResourceImpl - * @generated - */ -public class CatalogResourceFactoryImpl extends ResourceFactoryImpl { - /** - * Creates an instance of the resource factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CatalogResourceFactoryImpl() { - super(); - } - - /** - * Creates an instance of the resource. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public Resource createResource(URI uri) { - XMLResource result = new CatalogResourceImpl(uri); - result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - - result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); - result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); - return result; - } - -} //CatalogResourceFactoryImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceImpl.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceImpl.java deleted file mode 100644 index e8f22dd61..000000000 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogResourceImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id: CatalogResourceImpl.java,v 1.1 2006/07/11 16:57:15 mtaal Exp $ - */ -package org.eclipse.emf.teneo.samples.emf.sample.catalog.util; - -import org.eclipse.emf.common.util.URI; - -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; - -/** - * <!-- begin-user-doc --> - * The <b>Resource </b> associated with the package. - * <!-- end-user-doc --> - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.util.CatalogResourceFactoryImpl - * @generated - */ -public class CatalogResourceImpl extends XMLResourceImpl { - /** - * Creates an instance of the resource. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param uri the URI of the new resource. - * @generated - */ - public CatalogResourceImpl(URI uri) { - super(uri); - } - -} //CatalogResourceImpl diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogSwitch.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogSwitch.java deleted file mode 100644 index 094b63a05..000000000 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogSwitch.java +++ /dev/null @@ -1,214 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id: CatalogSwitch.java,v 1.3 2007/07/17 13:58:47 mtaal Exp $ - */ -package org.eclipse.emf.teneo.samples.emf.sample.catalog.util; - -import java.util.List; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.emf.teneo.samples.emf.sample.catalog.*; - -/** - * <!-- begin-user-doc --> - * The <b>Switch</b> for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the <code>caseXXX</code> method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * <!-- end-user-doc --> - * @see org.eclipse.emf.teneo.samples.emf.sample.catalog.CatalogPackage - * @generated - */ -public class CatalogSwitch<T> { - /** - * The cached model package - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected static CatalogPackage modelPackage; - - /** - * Creates an instance of the switch. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CatalogSwitch() { - if (modelPackage == null) { - modelPackage = CatalogPackage.eINSTANCE; - } - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - public T doSwitch(EObject theEObject) { - return doSwitch(theEObject.eClass(), theEObject); - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - protected T doSwitch(EClass theEClass, EObject theEObject) { - if (theEClass.eContainer() == modelPackage) { - return doSwitch(theEClass.getClassifierID(), theEObject); - } - else { - List<EClass> eSuperTypes = theEClass.getESuperTypes(); - return - eSuperTypes.isEmpty() ? - defaultCase(theEObject) : - doSwitch(eSuperTypes.get(0), theEObject); - } - } - - /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the first non-null result returned by a <code>caseXXX</code> call. - * @generated - */ - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case CatalogPackage.CATALOG_TYPE: { - CatalogType catalogType = (CatalogType)theEObject; - T result = caseCatalogType(catalogType); - if (result == null) result = defaultCase(theEObject); - return result; - } - case CatalogPackage.PRICE_TYPE: { - PriceType priceType = (PriceType)theEObject; - T result = casePriceType(priceType); - if (result == null) result = defaultCase(theEObject); - return result; - } - case CatalogPackage.PRODUCT_TYPE: { - ProductType productType = (ProductType)theEObject; - T result = caseProductType(productType); - if (result == null) result = defaultCase(theEObject); - return result; - } - case CatalogPackage.STRING_TYPE: { - StringType stringType = (StringType)theEObject; - T result = caseStringType(stringType); - if (result == null) result = defaultCase(theEObject); - return result; - } - case CatalogPackage.SUPPLIER_TYPE: { - SupplierType supplierType = (SupplierType)theEObject; - T result = caseSupplierType(supplierType); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCatalogType(CatalogType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Price Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>Price Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePriceType(PriceType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Product Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>Product Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseProductType(ProductType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>String Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>String Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseStringType(StringType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>Supplier Type</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>Supplier Type</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseSupplierType(SupplierType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of '<em>EObject</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - public T defaultCase(EObject object) { - return null; - } - -} //CatalogSwitch diff --git a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogXMLProcessor.java b/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogXMLProcessor.java deleted file mode 100644 index 916f8a3f4..000000000 --- a/examples/org.eclipse.emf.teneo.samples/src/org/eclipse/emf/teneo/samples/emf/sample/catalog/util/CatalogXMLProcessor.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * <copyright> - * </copyright> - * - * $Id: CatalogXMLProcessor.java,v 1.2 2007/02/08 23:09:25 mtaal Exp $ - */ -package org.eclipse.emf.teneo.samples.emf.sample.catalog.util; - -import java.util.Map; - -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.util.XMLProcessor; - -import org.eclipse.emf.teneo.samples.emf.sample.catalog.CatalogPackage; - -/** - * This class contains helper methods to serialize and deserialize XML documents - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ -public class CatalogXMLProcessor extends XMLProcessor { - /** - * Public constructor to instantiate the helper. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public CatalogXMLProcessor() { - super((EPackage.Registry.INSTANCE)); - CatalogPackage.eINSTANCE.eClass(); - } - - /** - * Register for "*" and "xml" file extensions the CatalogResourceFactoryImpl factory. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected Map<String, Resource.Factory> getRegistrations() { - if (registrations == null) { - super.getRegistrations(); - registrations.put(XML_EXTENSION, new CatalogResourceFactoryImpl()); - registrations.put(STAR_EXTENSION, new CatalogResourceFactoryImpl()); - } - return registrations; - } - -} //CatalogXMLProcessor |