diff options
author | S.John | 2019-09-05 12:10:57 +0000 |
---|---|---|
committer | S.John | 2019-09-16 07:38:00 +0000 |
commit | ad0a7f02874fd0a373c4de456fdd65e48d761b7f (patch) | |
tree | 75e95a841746d6eda7f42f5ae207057bce71d0f4 /plugins/org.eclipse.emf.henshin.examples/src/org | |
parent | 51c8e8b77f4afd0f4dbb7a394ed82d2d5adfa331 (diff) | |
download | org.eclipse.emft.henshin-ad0a7f02874fd0a373c4de456fdd65e48d761b7f.tar.gz org.eclipse.emft.henshin-ad0a7f02874fd0a373c4de456fdd65e48d761b7f.tar.xz org.eclipse.emft.henshin-ad0a7f02874fd0a373c4de456fdd65e48d761b7f.zip |
added example for using the Henshin/EMF api
Signed-off-by: S.John <stefan.john@uni-marburg.de>
Diffstat (limited to 'plugins/org.eclipse.emf.henshin.examples/src/org')
27 files changed, 2347 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/CreateAndStoreModel.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/CreateAndStoreModel.java new file mode 100644 index 000000000..facabbbda --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/CreateAndStoreModel.java @@ -0,0 +1,53 @@ +package org.eclipse.emf.henshin.examples.apibasics; + +import java.io.IOException; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingFactory; +import org.eclipse.emf.henshin.model.resource.HenshinResourceSet; + +public class CreateAndStoreModel { + + // The dir used by the HenshinResourceSet to resolve relative paths. + private static final String BASEDIR = "src/org/eclipse/emf/henshin/examples/apibasics/models"; + + public static void main(String[] args) { + EObject model = createModel(); + saveModel(model); + } + + public static EObject createModel() { + // Model elements can be created by the generated factory. + BoxingFactory fac = BoxingFactory.eINSTANCE; + Boxing boxing = fac.createBoxing(); + + /* + * Getters for attributes and references are automatically generated by + * the code* generator. Use them to get and changes the contents of the + * model elements. + */ + boxing.getBoxes().add(fac.createBox()); + boxing.getItems().add(fac.createItem()); + return boxing; + } + + public static void saveModel(EObject model) { + /* + * Models can be saved by putting them into a Resource. Resources are + * managed by ResourceSets. The Henshin versions of these types are a + * bit easier to use. + */ + HenshinResourceSet rs = new HenshinResourceSet(BASEDIR); + Resource res = rs.createResource("createdInstanceStatic.xmi"); + res.getContents().add(model); + + try { + res.save(null); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/ExecuteHenshinRule.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/ExecuteHenshinRule.java new file mode 100644 index 000000000..c2ee06eae --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/ExecuteHenshinRule.java @@ -0,0 +1,72 @@ +package org.eclipse.emf.henshin.examples.apibasics; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.henshin.interpreter.EGraph; +import org.eclipse.emf.henshin.interpreter.Engine; +import org.eclipse.emf.henshin.interpreter.UnitApplication; +import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl; +import org.eclipse.emf.henshin.interpreter.impl.EngineImpl; +import org.eclipse.emf.henshin.interpreter.impl.LoggingApplicationMonitor; +import org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl; +import org.eclipse.emf.henshin.model.Module; +import org.eclipse.emf.henshin.model.Unit; +import org.eclipse.emf.henshin.model.resource.HenshinResourceSet; + +public class ExecuteHenshinRule { + + public static void main(String[] args) { + EObject modelRoot = LoadModel.loadModel(); + + /* + * Generally it is a good idea to use the same ResourceSet for loading + * the model and the Henshin rules as it is less error prone. + */ + HenshinResourceSet rs = (HenshinResourceSet) modelRoot.eResource() + .getResourceSet(); + + /* + * Static rules need to be used when working with static models. + * When creating a .henshin file, make sure to add the metamodel + * "From Registry" and not via the .ecore file. + * To add the metamodel to the Registry, start a new Eclipse + * instance (right click on project -> Run as -> Eclipse Application) + * from the workspace containing you metamodel classes. In that new + * instance you should be able to create henshin diagrams using + * the "From Registry" button to load the model. + * + * You might want to compare rulesStatic and rulesDynamic in a text + * editor to learn about the differences. + */ + Module rules = rs.getModule("rulesStatic.henshin", true); + Unit testRule = rules.getUnit("addItemToBox"); + + /* For performance reasons you should reuse the Engine and EGraph in + * your code when possible. However, do NOT reuse UnitApplications if + * you don't have a specific reason for that. UnitApplication keep some + * state of former rule executions. Reusing them can lead to unintended + * behavior. + */ + Engine engine = new EngineImpl(); + EGraph graph = new EGraphImpl(modelRoot); + + /* + * If multiple macthes for a rule exists in a model, the following + * allows a rule to select randomly where it is applied. + */ + engine.getOptions().put(Engine.OPTION_DETERMINISTIC, false); + + UnitApplication application = new UnitApplicationImpl(engine, graph, testRule, null); + + /* + * If you want to analyse the execution of a rule you can use a + * LoggingApplicationMonitor to get some feedback on console. + * Otherwise use null as parameter. + */ + application.execute(new LoggingApplicationMonitor()); + } +} + +/* + * For more information on using the Henshin API visit + * https://wiki.eclipse.org/Henshin/Interpreter. + */
\ No newline at end of file diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/LoadModel.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/LoadModel.java new file mode 100644 index 000000000..2af6c6bc1 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/LoadModel.java @@ -0,0 +1,67 @@ +package org.eclipse.emf.henshin.examples.apibasics; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.model.resource.HenshinResourceSet; + +public class LoadModel { + + // The dir used by the HenshinResourceSet to resolve relative paths. + private static final String BASEDIR = "src/org/eclipse/emf/henshin/examples/apibasics/models"; + + public static void main(String[] args) { + + EObject modelRoot = loadModel(); + + /* + * If you registered the metamodel, you should have an object with the + * type of your model root. In that case, you can cast to the concrete + * type if you need to access model elements. + */ + System.out.println("Type of the root: " + modelRoot.getClass()); + Boxing boxing = (Boxing) modelRoot; + System.out.println("First item: " + boxing.getItems().get(0)); + } + + public static EObject loadModel() { + + HenshinResourceSet rs = new HenshinResourceSet(BASEDIR); + /* + * Metamodels need to be registered in order to use instance models in + * a static way (using the classes with their specific getters + * generated for your model. This can be done by registering the + * package of your model in the package registry of the ResourceSet + * which you use to load instance models. + * In that case, it does not matter if the loaded model has been + * created as a static model (e.g. by using the api as shown in + * CreateAndStoreModel.java) or if it is a dynamic model created by, + * e.g., right clicking the root in the .ecore file and choosing + * "Create Dynamic Instance...". + * + * You might want to compare instanceStatic and instanceDynamic in a + * text editor to learn about the differences. + */ + rs.getPackageRegistry().put(BoxingPackage.eINSTANCE.getNsURI(), + BoxingPackage.eINSTANCE); + Resource res = rs.getResource("instanceStatic.xmi"); + + /* + * Usually there is only one model root stored in an xmi file. So + * getContents() should return a list with one element. + */ + EObject modelRoot = res.getContents().get(0); + + + /* WARNING: + * If the metamodel is not registered before loading, you are working + * with dynamic models. In that case you can access all model elements + * only by very generic reflective accessor methods. If you think you + * need dynamic EMF more info can be found here: + * https://www.ibm.com/developerworks/library/os-eclipse-dynamicemf + */ + + return modelRoot; + } +} diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/TestRule.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/TestRule.java new file mode 100644 index 000000000..b6383fd2e --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/TestRule.java @@ -0,0 +1,101 @@ +package org.eclipse.emf.henshin.examples.apibasics; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.interpreter.Engine; +import org.eclipse.emf.henshin.interpreter.UnitApplication; +import org.eclipse.emf.henshin.interpreter.impl.EGraphImpl; +import org.eclipse.emf.henshin.interpreter.impl.EngineImpl; +import org.eclipse.emf.henshin.interpreter.impl.LoggingApplicationMonitor; +import org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl; +import org.eclipse.emf.henshin.model.Module; +import org.eclipse.emf.henshin.model.resource.HenshinResourceSet; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class TestRule { + + private static final String BASEDIR = "src/org/eclipse/emf/henshin/examples/apibasics/models"; + + private static Engine engine; + private static Resource modelResource; + private static EObject model; + private static List<EObject> roots; + private static Module module; + private static UnitApplication unitApp; + private static HenshinResourceSet rs; + + /* + * Create the ResourceSet where models and rules are managed in and + * register metamodel. + */ + @BeforeAll + public static void setup() { + rs = new HenshinResourceSet(BASEDIR); + rs.getPackageRegistry().put(BoxingPackage.eINSTANCE.getNsURI(), BoxingPackage.eINSTANCE); + engine = new EngineImpl(); + } + + /* + * Before each new test, the resource holding the input model and the rules + * need to be reset. This is necessary as + * "modelResource = rs.getResource("xyz.xmi")" will not load the model xyz + * again if it is already loaded by modelResource. As a consequence, + * changes we applied to xyz would not be discarded if we don't unload the + * model first. Additionally, we might want to slightly change the tested + * rules (e.g., to make them deterministic) in a test case. The same + * principle as for the model applies; we need to use unload to reset the + * rules. + */ + @BeforeEach + public void resetUnitApp() { + if (modelResource != null) { + modelResource.unload(); + } + rs.getResource("rulesStatic.henshin").unload(); + module = rs.getModule("rulesStatic.henshin"); + unitApp = new UnitApplicationImpl(engine); + } + + /* + * The actual test case needs to load the input model, apply the rule and + * check the resulting model. + */ + @Test + void testItemIsAlreadyStored() { + // The path is still resolved against the BASEDIR. + modelResource = rs.getResource("../testModels/storedItem.xmi"); + + // Another way to load a model into an EGraph + roots = modelResource.getContents(); + unitApp.setEGraph(new EGraphImpl(roots)); + unitApp.setUnit(module.getUnit("addItemToBox")); + + assertFalse(unitApp.execute(new LoggingApplicationMonitor())); + } + + + @Test + void testItemGetsStored() { + modelResource = rs.getResource("../testModels/unstoredItem.xmi"); + + roots = modelResource.getContents(); + unitApp.setEGraph(new EGraphImpl(roots)); + unitApp.setUnit(module.getUnit("addItemToBox")); + + assertTrue(unitApp.execute(null)); + + // Get resulting model from graph + Boxing boxing = (Boxing)unitApp.getEGraph().getRoots().get(0); + assertTrue(boxing.getBoxes().get(0).getStores().get(0) == boxing.getItems().get(0)); + } + +} diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Box.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Box.java new file mode 100644 index 000000000..f6ca97463 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Box.java @@ -0,0 +1,40 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Box</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box#getStores <em>Stores</em>}</li> + * </ul> + * + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getBox() + * @model + * @generated + */ +public interface Box extends EObject { + /** + * Returns the value of the '<em><b>Stores</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item}. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy <em>Is Stored By</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the value of the '<em>Stores</em>' reference list. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getBox_Stores() + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy + * @model opposite="isStoredBy" + * @generated + */ + EList<Item> getStores(); + +} // Box diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Boxing.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Boxing.java new file mode 100644 index 000000000..d09fcf4db --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Boxing.java @@ -0,0 +1,51 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Boxing</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getBoxes <em>Boxes</em>}</li> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getItems <em>Items</em>}</li> + * </ul> + * + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getBoxing() + * @model + * @generated + */ +public interface Boxing extends EObject { + /** + * Returns the value of the '<em><b>Boxes</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the value of the '<em>Boxes</em>' containment reference list. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getBoxing_Boxes() + * @model containment="true" + * @generated + */ + EList<Box> getBoxes(); + + /** + * Returns the value of the '<em><b>Items</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the value of the '<em>Items</em>' containment reference list. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getBoxing_Items() + * @model containment="true" + * @generated + */ + EList<Item> getItems(); + +} // Boxing diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingFactory.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingFactory.java new file mode 100644 index 000000000..5ed8dc6c9 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingFactory.java @@ -0,0 +1,60 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- 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.emf.henshin.examples.apibasics.boxing.BoxingPackage + * @generated + */ +public interface BoxingFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + BoxingFactory eINSTANCE = org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Boxing</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Boxing</em>'. + * @generated + */ + Boxing createBoxing(); + + /** + * Returns a new object of class '<em>Box</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Box</em>'. + * @generated + */ + Box createBox(); + + /** + * Returns a new object of class '<em>Item</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Item</em>'. + * @generated + */ + Item createItem(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + BoxingPackage getBoxingPackage(); + +} //BoxingFactory diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingPackage.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingPackage.java new file mode 100644 index 000000000..5e2fed526 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/BoxingPackage.java @@ -0,0 +1,340 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingFactory + * @model kind="package" + * @generated + */ +public interface BoxingPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "boxing"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "www.boxing.com"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "boxing"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + BoxingPackage eINSTANCE = org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl <em>Boxing</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getBoxing() + * @generated + */ + int BOXING = 0; + + /** + * The feature id for the '<em><b>Boxes</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOXING__BOXES = 0; + + /** + * The feature id for the '<em><b>Items</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOXING__ITEMS = 1; + + /** + * The number of structural features of the '<em>Boxing</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOXING_FEATURE_COUNT = 2; + + /** + * The number of operations of the '<em>Boxing</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOXING_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxImpl <em>Box</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getBox() + * @generated + */ + int BOX = 1; + + /** + * The feature id for the '<em><b>Stores</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOX__STORES = 0; + + /** + * The number of structural features of the '<em>Box</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOX_FEATURE_COUNT = 1; + + /** + * The number of operations of the '<em>Box</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int BOX_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.ItemImpl <em>Item</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.ItemImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getItem() + * @generated + */ + int ITEM = 2; + + /** + * The feature id for the '<em><b>Is Stored By</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ITEM__IS_STORED_BY = 0; + + /** + * The number of structural features of the '<em>Item</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ITEM_FEATURE_COUNT = 1; + + /** + * The number of operations of the '<em>Item</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ITEM_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing <em>Boxing</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Boxing</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing + * @generated + */ + EClass getBoxing(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getBoxes <em>Boxes</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Boxes</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getBoxes() + * @see #getBoxing() + * @generated + */ + EReference getBoxing_Boxes(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getItems <em>Items</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Items</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing#getItems() + * @see #getBoxing() + * @generated + */ + EReference getBoxing_Items(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box <em>Box</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Box</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Box + * @generated + */ + EClass getBox(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box#getStores <em>Stores</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Stores</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Box#getStores() + * @see #getBox() + * @generated + */ + EReference getBox_Stores(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item <em>Item</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Item</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Item + * @generated + */ + EClass getItem(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy <em>Is Stored By</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Is Stored By</em>'. + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy() + * @see #getItem() + * @generated + */ + EReference getItem_IsStoredBy(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + BoxingFactory getBoxingFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl <em>Boxing</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getBoxing() + * @generated + */ + EClass BOXING = eINSTANCE.getBoxing(); + + /** + * The meta object literal for the '<em><b>Boxes</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference BOXING__BOXES = eINSTANCE.getBoxing_Boxes(); + + /** + * The meta object literal for the '<em><b>Items</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference BOXING__ITEMS = eINSTANCE.getBoxing_Items(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxImpl <em>Box</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getBox() + * @generated + */ + EClass BOX = eINSTANCE.getBox(); + + /** + * The meta object literal for the '<em><b>Stores</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference BOX__STORES = eINSTANCE.getBox_Stores(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.ItemImpl <em>Item</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.ItemImpl + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingPackageImpl#getItem() + * @generated + */ + EClass ITEM = eINSTANCE.getItem(); + + /** + * The meta object literal for the '<em><b>Is Stored By</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference ITEM__IS_STORED_BY = eINSTANCE.getItem_IsStoredBy(); + + } + +} //BoxingPackage diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Item.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Item.java new file mode 100644 index 000000000..11673b59b --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/Item.java @@ -0,0 +1,48 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Item</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy <em>Is Stored By</em>}</li> + * </ul> + * + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getItem() + * @model + * @generated + */ +public interface Item extends EObject { + /** + * Returns the value of the '<em><b>Is Stored By</b></em>' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box#getStores <em>Stores</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the value of the '<em>Is Stored By</em>' reference. + * @see #setIsStoredBy(Box) + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#getItem_IsStoredBy() + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.Box#getStores + * @model opposite="stores" + * @generated + */ + Box getIsStoredBy(); + + /** + * Sets the value of the '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item#getIsStoredBy <em>Is Stored By</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Is Stored By</em>' reference. + * @see #getIsStoredBy() + * @generated + */ + void setIsStoredBy(Box value); + +} // Item diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxImpl.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxImpl.java new file mode 100644 index 000000000..88e2cf0af --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxImpl.java @@ -0,0 +1,166 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Box; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Item; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Box</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxImpl#getStores <em>Stores</em>}</li> + * </ul> + * + * @generated + */ +public class BoxImpl extends MinimalEObjectImpl.Container implements Box { + /** + * The cached value of the '{@link #getStores() <em>Stores</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStores() + * @generated + * @ordered + */ + protected EList<Item> stores; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BoxImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return BoxingPackage.Literals.BOX; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Item> getStores() { + if (stores == null) { + stores = new EObjectWithInverseResolvingEList<Item>(Item.class, this, BoxingPackage.BOX__STORES, BoxingPackage.ITEM__IS_STORED_BY); + } + return stores; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getStores()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + return ((InternalEList<?>)getStores()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + return getStores(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + getStores().clear(); + getStores().addAll((Collection<? extends Item>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + getStores().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BoxingPackage.BOX__STORES: + return stores != null && !stores.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //BoxImpl diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingFactoryImpl.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingFactoryImpl.java new file mode 100644 index 000000000..930e9c123 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingFactoryImpl.java @@ -0,0 +1,116 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.impl; + +import org.eclipse.emf.ecore.EClass; +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.emf.henshin.examples.apibasics.boxing.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class BoxingFactoryImpl extends EFactoryImpl implements BoxingFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static BoxingFactory init() { + try { + BoxingFactory theBoxingFactory = (BoxingFactory)EPackage.Registry.INSTANCE.getEFactory(BoxingPackage.eNS_URI); + if (theBoxingFactory != null) { + return theBoxingFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new BoxingFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BoxingFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case BoxingPackage.BOXING: return createBoxing(); + case BoxingPackage.BOX: return createBox(); + case BoxingPackage.ITEM: return createItem(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Boxing createBoxing() { + BoxingImpl boxing = new BoxingImpl(); + return boxing; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Box createBox() { + BoxImpl box = new BoxImpl(); + return box; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Item createItem() { + ItemImpl item = new ItemImpl(); + return item; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BoxingPackage getBoxingPackage() { + return (BoxingPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static BoxingPackage getPackage() { + return BoxingPackage.eINSTANCE; + } + +} //BoxingFactoryImpl diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingImpl.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingImpl.java new file mode 100644 index 000000000..a6e5d107d --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingImpl.java @@ -0,0 +1,187 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Box; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Item; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Boxing</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl#getBoxes <em>Boxes</em>}</li> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.BoxingImpl#getItems <em>Items</em>}</li> + * </ul> + * + * @generated + */ +public class BoxingImpl extends MinimalEObjectImpl.Container implements Boxing { + /** + * The cached value of the '{@link #getBoxes() <em>Boxes</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getBoxes() + * @generated + * @ordered + */ + protected EList<Box> boxes; + + /** + * The cached value of the '{@link #getItems() <em>Items</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getItems() + * @generated + * @ordered + */ + protected EList<Item> items; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BoxingImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return BoxingPackage.Literals.BOXING; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Box> getBoxes() { + if (boxes == null) { + boxes = new EObjectContainmentEList<Box>(Box.class, this, BoxingPackage.BOXING__BOXES); + } + return boxes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<Item> getItems() { + if (items == null) { + items = new EObjectContainmentEList<Item>(Item.class, this, BoxingPackage.BOXING__ITEMS); + } + return items; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BoxingPackage.BOXING__BOXES: + return ((InternalEList<?>)getBoxes()).basicRemove(otherEnd, msgs); + case BoxingPackage.BOXING__ITEMS: + return ((InternalEList<?>)getItems()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BoxingPackage.BOXING__BOXES: + return getBoxes(); + case BoxingPackage.BOXING__ITEMS: + return getItems(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BoxingPackage.BOXING__BOXES: + getBoxes().clear(); + getBoxes().addAll((Collection<? extends Box>)newValue); + return; + case BoxingPackage.BOXING__ITEMS: + getItems().clear(); + getItems().addAll((Collection<? extends Item>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BoxingPackage.BOXING__BOXES: + getBoxes().clear(); + return; + case BoxingPackage.BOXING__ITEMS: + getItems().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BoxingPackage.BOXING__BOXES: + return boxes != null && !boxes.isEmpty(); + case BoxingPackage.BOXING__ITEMS: + return items != null && !items.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //BoxingImpl diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingPackageImpl.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingPackageImpl.java new file mode 100644 index 000000000..23864bedb --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/BoxingPackageImpl.java @@ -0,0 +1,251 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Box; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Boxing; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingFactory; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Item; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class BoxingPackageImpl extends EPackageImpl implements BoxingPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass boxingEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass boxEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass itemEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage#eNS_URI + * @see #init() + * @generated + */ + private BoxingPackageImpl() { + super(eNS_URI, BoxingFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link BoxingPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static BoxingPackage init() { + if (isInited) return (BoxingPackage)EPackage.Registry.INSTANCE.getEPackage(BoxingPackage.eNS_URI); + + // Obtain or create and register package + Object registeredBoxingPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + BoxingPackageImpl theBoxingPackage = registeredBoxingPackage instanceof BoxingPackageImpl ? (BoxingPackageImpl)registeredBoxingPackage : new BoxingPackageImpl(); + + isInited = true; + + // Create package meta-data objects + theBoxingPackage.createPackageContents(); + + // Initialize created meta-data + theBoxingPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theBoxingPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(BoxingPackage.eNS_URI, theBoxingPackage); + return theBoxingPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getBoxing() { + return boxingEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getBoxing_Boxes() { + return (EReference)boxingEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getBoxing_Items() { + return (EReference)boxingEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getBox() { + return boxEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getBox_Stores() { + return (EReference)boxEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getItem() { + return itemEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getItem_IsStoredBy() { + return (EReference)itemEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BoxingFactory getBoxingFactory() { + return (BoxingFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + boxingEClass = createEClass(BOXING); + createEReference(boxingEClass, BOXING__BOXES); + createEReference(boxingEClass, BOXING__ITEMS); + + boxEClass = createEClass(BOX); + createEReference(boxEClass, BOX__STORES); + + itemEClass = createEClass(ITEM); + createEReference(itemEClass, ITEM__IS_STORED_BY); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(boxingEClass, Boxing.class, "Boxing", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getBoxing_Boxes(), this.getBox(), null, "boxes", null, 0, -1, Boxing.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getBoxing_Items(), this.getItem(), null, "items", null, 0, -1, Boxing.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(boxEClass, Box.class, "Box", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getBox_Stores(), this.getItem(), this.getItem_IsStoredBy(), "stores", null, 0, -1, Box.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(itemEClass, Item.class, "Item", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getItem_IsStoredBy(), this.getBox(), this.getBox_Stores(), "isStoredBy", null, 0, 1, Item.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //BoxingPackageImpl diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/ItemImpl.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/ItemImpl.java new file mode 100644 index 000000000..9be37e177 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/impl/ItemImpl.java @@ -0,0 +1,209 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Box; +import org.eclipse.emf.henshin.examples.apibasics.boxing.BoxingPackage; +import org.eclipse.emf.henshin.examples.apibasics.boxing.Item; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Item</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.emf.henshin.examples.apibasics.boxing.impl.ItemImpl#getIsStoredBy <em>Is Stored By</em>}</li> + * </ul> + * + * @generated + */ +public class ItemImpl extends MinimalEObjectImpl.Container implements Item { + /** + * The cached value of the '{@link #getIsStoredBy() <em>Is Stored By</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getIsStoredBy() + * @generated + * @ordered + */ + protected Box isStoredBy; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ItemImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return BoxingPackage.Literals.ITEM; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Box getIsStoredBy() { + if (isStoredBy != null && isStoredBy.eIsProxy()) { + InternalEObject oldIsStoredBy = (InternalEObject)isStoredBy; + isStoredBy = (Box)eResolveProxy(oldIsStoredBy); + if (isStoredBy != oldIsStoredBy) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, BoxingPackage.ITEM__IS_STORED_BY, oldIsStoredBy, isStoredBy)); + } + } + return isStoredBy; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Box basicGetIsStoredBy() { + return isStoredBy; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public NotificationChain basicSetIsStoredBy(Box newIsStoredBy, NotificationChain msgs) { + Box oldIsStoredBy = isStoredBy; + isStoredBy = newIsStoredBy; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BoxingPackage.ITEM__IS_STORED_BY, oldIsStoredBy, newIsStoredBy); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setIsStoredBy(Box newIsStoredBy) { + if (newIsStoredBy != isStoredBy) { + NotificationChain msgs = null; + if (isStoredBy != null) + msgs = ((InternalEObject)isStoredBy).eInverseRemove(this, BoxingPackage.BOX__STORES, Box.class, msgs); + if (newIsStoredBy != null) + msgs = ((InternalEObject)newIsStoredBy).eInverseAdd(this, BoxingPackage.BOX__STORES, Box.class, msgs); + msgs = basicSetIsStoredBy(newIsStoredBy, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, BoxingPackage.ITEM__IS_STORED_BY, newIsStoredBy, newIsStoredBy)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + if (isStoredBy != null) + msgs = ((InternalEObject)isStoredBy).eInverseRemove(this, BoxingPackage.BOX__STORES, Box.class, msgs); + return basicSetIsStoredBy((Box)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + return basicSetIsStoredBy(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + if (resolve) return getIsStoredBy(); + return basicGetIsStoredBy(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + setIsStoredBy((Box)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + setIsStoredBy((Box)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case BoxingPackage.ITEM__IS_STORED_BY: + return isStoredBy != null; + } + return super.eIsSet(featureID); + } + +} //ItemImpl diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingAdapterFactory.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingAdapterFactory.java new file mode 100644 index 000000000..e7be6da67 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingAdapterFactory.java @@ -0,0 +1,155 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.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.henshin.examples.apibasics.boxing.*; + +/** + * <!-- 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.henshin.examples.apibasics.boxing.BoxingPackage + * @generated + */ +public class BoxingAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static BoxingPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BoxingAdapterFactory() { + if (modelPackage == null) { + modelPackage = BoxingPackage.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 that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected BoxingSwitch<Adapter> modelSwitch = + new BoxingSwitch<Adapter>() { + @Override + public Adapter caseBoxing(Boxing object) { + return createBoxingAdapter(); + } + @Override + public Adapter caseBox(Box object) { + return createBoxAdapter(); + } + @Override + public Adapter caseItem(Item object) { + return createItemAdapter(); + } + @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.henshin.examples.apibasics.boxing.Boxing <em>Boxing</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.henshin.examples.apibasics.boxing.Boxing + * @generated + */ + public Adapter createBoxingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Box <em>Box</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.henshin.examples.apibasics.boxing.Box + * @generated + */ + public Adapter createBoxAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.henshin.examples.apibasics.boxing.Item <em>Item</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.henshin.examples.apibasics.boxing.Item + * @generated + */ + public Adapter createItemAdapter() { + 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; + } + +} //BoxingAdapterFactory diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingSwitch.java b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingSwitch.java new file mode 100644 index 000000000..2acfd04ab --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/boxing/util/BoxingSwitch.java @@ -0,0 +1,151 @@ +/** + */ +package org.eclipse.emf.henshin.examples.apibasics.boxing.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.emf.henshin.examples.apibasics.boxing.*; + +/** + * <!-- 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.henshin.examples.apibasics.boxing.BoxingPackage + * @generated + */ +public class BoxingSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static BoxingPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public BoxingSwitch() { + if (modelPackage == null) { + modelPackage = BoxingPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * 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 + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case BoxingPackage.BOXING: { + Boxing boxing = (Boxing)theEObject; + T result = caseBoxing(boxing); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BoxingPackage.BOX: { + Box box = (Box)theEObject; + T result = caseBox(box); + if (result == null) result = defaultCase(theEObject); + return result; + } + case BoxingPackage.ITEM: { + Item item = (Item)theEObject; + T result = caseItem(item); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Boxing</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>Boxing</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBoxing(Boxing object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Box</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>Box</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBox(Box object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Item</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>Item</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseItem(Item 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 + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //BoxingSwitch diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.ecore b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.ecore new file mode 100644 index 000000000..9666ea47e --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.ecore @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="boxing" nsURI="www.boxing.com" nsPrefix="boxing"> + <eClassifiers xsi:type="ecore:EClass" name="Boxing"> + <eStructuralFeatures xsi:type="ecore:EReference" name="boxes" upperBound="-1" + eType="#//Box" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="items" upperBound="-1" + eType="#//Item" containment="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Box"> + <eStructuralFeatures xsi:type="ecore:EReference" name="stores" upperBound="-1" + eType="#//Item" eOpposite="#//Item/isStoredBy"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Item"> + <eStructuralFeatures xsi:type="ecore:EReference" name="isStoredBy" eType="#//Box" + eOpposite="#//Box/stores"/> + </eClassifiers> +</ecore:EPackage> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.genmodel b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.genmodel new file mode 100644 index 000000000..56ef63696 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/boxing.genmodel @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/EMF_Henshin_API_examples/src" modelPluginID="EMF_Henshin_API_examples" + modelName="Boxing" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false" + operationReflection="true" importOrganizing="true"> + <foreignModel>boxing.ecore</foreignModel> + <genPackages prefix="Boxing" disposableProviderFactory="true" ecorePackage="boxing.ecore#/"> + <genClasses ecoreClass="boxing.ecore#//Boxing"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference boxing.ecore#//Boxing/boxes"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference boxing.ecore#//Boxing/items"/> + </genClasses> + <genClasses ecoreClass="boxing.ecore#//Box"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference boxing.ecore#//Box/stores"/> + </genClasses> + <genClasses ecoreClass="boxing.ecore#//Item"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference boxing.ecore#//Item/isStoredBy"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceDynamic.xmi b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceDynamic.xmi new file mode 100644 index 000000000..90649dd9e --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceDynamic.xmi @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<boxing:Boxing xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:boxing="www.boxing.com" + xsi:schemaLocation="www.boxing.com boxing.ecore"> + <boxes/> + <items/> +</boxing:Boxing> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceStatic.xmi b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceStatic.xmi new file mode 100644 index 000000000..22854c9ea --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/instanceStatic.xmi @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<boxing:Boxing xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:boxing="www.boxing.com"> + <boxes/> + <items/> +</boxing:Boxing> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin new file mode 100644 index 000000000..b2e2b0994 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmi:id="_yJq_EL9ZEemme_wk7Csgrw"> + <imports href="boxing.ecore#/"/> + <units xsi:type="henshin:Rule" xmi:id="_y4tPUL9ZEemme_wk7Csgrw" name="addItemToBox"> + <lhs xmi:id="_y43nYL9ZEemme_wk7Csgrw" name="Lhs"> + <nodes xmi:id="_1PrtwL9ZEemme_wk7Csgrw" name="b"> + <type href="boxing.ecore#//Box"/> + </nodes> + <nodes xmi:id="_2A4hML9ZEemme_wk7Csgrw" name="i"> + <type href="boxing.ecore#//Item"/> + </nodes> + <formula xsi:type="henshin:Not" xmi:id="_3TJaUL9ZEemme_wk7Csgrw"> + <child xsi:type="henshin:NestedCondition" xmi:id="_3TJaUb9ZEemme_wk7Csgrw"> + <conclusion xmi:id="_3TJaUr9ZEemme_wk7Csgrw"> + <nodes xmi:id="_3TKBYL9ZEemme_wk7Csgrw" name="b" outgoing="_2oCn0L9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Box"/> + </nodes> + <nodes xmi:id="_3TKBYr9ZEemme_wk7Csgrw" name="i" incoming="_2oCn0L9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Item"/> + </nodes> + <edges xmi:id="_2oCn0L9ZEemme_wk7Csgrw" source="_3TKBYL9ZEemme_wk7Csgrw" target="_3TKBYr9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Box/stores"/> + </edges> + </conclusion> + <mappings xmi:id="_3TKBYb9ZEemme_wk7Csgrw" origin="_1PrtwL9ZEemme_wk7Csgrw" image="_3TKBYL9ZEemme_wk7Csgrw"/> + <mappings xmi:id="_3TKBY79ZEemme_wk7Csgrw" origin="_2A4hML9ZEemme_wk7Csgrw" image="_3TKBYr9ZEemme_wk7Csgrw"/> + </child> + </formula> + </lhs> + <rhs xmi:id="_y43nYb9ZEemme_wk7Csgrw" name="Rhs"> + <nodes xmi:id="_1Prtwb9ZEemme_wk7Csgrw" name="b" outgoing="_58lhwL9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Box"/> + </nodes> + <nodes xmi:id="_2A4hMb9ZEemme_wk7Csgrw" name="i" incoming="_58lhwL9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Item"/> + </nodes> + <edges xmi:id="_58lhwL9ZEemme_wk7Csgrw" source="_1Prtwb9ZEemme_wk7Csgrw" target="_2A4hMb9ZEemme_wk7Csgrw"> + <type href="boxing.ecore#//Box/stores"/> + </edges> + </rhs> + <mappings xmi:id="_1PsU0L9ZEemme_wk7Csgrw" origin="_1PrtwL9ZEemme_wk7Csgrw" image="_1Prtwb9ZEemme_wk7Csgrw"/> + <mappings xmi:id="_2A4hMr9ZEemme_wk7Csgrw" origin="_2A4hML9ZEemme_wk7Csgrw" image="_2A4hMb9ZEemme_wk7Csgrw"/> + </units> +</henshin:Module> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin_diagram b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin_diagram new file mode 100644 index 000000000..ed03a7bca --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesDynamic.henshin_diagram @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_yJrmIL9ZEemme_wk7Csgrw" type="Henshin" name="rulesDynamic.henshin_diagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_y4zV8L9ZEemme_wk7Csgrw" type="2001" fontName="Segoe UI" italic="true" lineColor="0"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_1PsU0b9ZEemme_wk7Csgrw" source="defaultAction"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_1PsU0r9ZEemme_wk7Csgrw" key="value" value="preserve"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_y4z9AL9ZEemme_wk7Csgrw" type="5001"/> + <children xmi:type="notation:DecorationNode" xmi:id="_y4z9Ab9ZEemme_wk7Csgrw" type="7001"> + <children xmi:type="notation:Shape" xmi:id="_1PuKAL9ZEemme_wk7Csgrw" type="3001" fontName="Segoe UI"> + <children xmi:type="notation:DecorationNode" xmi:id="_1PuxEL9ZEemme_wk7Csgrw" type="5002"/> + <children xmi:type="notation:DecorationNode" xmi:id="_1PuxEb9ZEemme_wk7Csgrw" type="5003"/> + <children xmi:type="notation:DecorationNode" xmi:id="_1PuxEr9ZEemme_wk7Csgrw" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_1PuxE79ZEemme_wk7Csgrw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_1PuxFL9ZEemme_wk7Csgrw"/> + </children> + <element xmi:type="henshin:Node" href="rulesDynamic.henshin#_1PrtwL9ZEemme_wk7Csgrw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1PuKAb9ZEemme_wk7Csgrw" x="44" y="51"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_2A5IQL9ZEemme_wk7Csgrw" type="3001" fontName="Segoe UI"> + <children xmi:type="notation:DecorationNode" xmi:id="_2A5vUL9ZEemme_wk7Csgrw" type="5002"/> + <children xmi:type="notation:DecorationNode" xmi:id="_2A5vUb9ZEemme_wk7Csgrw" type="5003"/> + <children xmi:type="notation:DecorationNode" xmi:id="_2A5vUr9ZEemme_wk7Csgrw" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_2A5vU79ZEemme_wk7Csgrw"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_2A5vVL9ZEemme_wk7Csgrw"/> + </children> + <element xmi:type="henshin:Node" href="rulesDynamic.henshin#_2A4hML9ZEemme_wk7Csgrw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2A5IQb9ZEemme_wk7Csgrw" x="232" y="98"/> + </children> + </children> + <element xmi:type="henshin:Rule" href="rulesDynamic.henshin#_y4tPUL9ZEemme_wk7Csgrw"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_y4zV8b9ZEemme_wk7Csgrw" x="233" y="275" width="381" height="224"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_yJrmIb9ZEemme_wk7Csgrw"/> + <element xmi:type="henshin:Module" href="rulesDynamic.henshin#_yJq_EL9ZEemme_wk7Csgrw"/> + <edges xmi:type="notation:Connector" xmi:id="_2oEdAL9ZEemme_wk7Csgrw" type="4001" source="_1PuKAL9ZEemme_wk7Csgrw" target="_2A5IQL9ZEemme_wk7Csgrw"> + <children xmi:type="notation:DecorationNode" xmi:id="_2oFEEL9ZEemme_wk7Csgrw" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_2oFEEb9ZEemme_wk7Csgrw" x="-27" y="16"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_2oFEEr9ZEemme_wk7Csgrw" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_2oFrIL9ZEemme_wk7Csgrw" x="-28" y="32"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_2oEdAb9ZEemme_wk7Csgrw" fontName="Segoe UI"/> + <element xmi:type="henshin:Edge" href="rulesDynamic.henshin#_2oCn0L9ZEemme_wk7Csgrw"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_2oEdAr9ZEemme_wk7Csgrw" points="[0, 7, -199, -37]$[0, 44, -199, 0]$[157, 44, -42, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2oJ8kL9ZEemme_wk7Csgrw" id="(0.5081967213114754,0.8333333333333334)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2oJ8kb9ZEemme_wk7Csgrw" id="(0.6885245901639344,0.7619047619047619)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_58mv4L9ZEemme_wk7Csgrw" type="4001" source="_1PuKAL9ZEemme_wk7Csgrw" target="_2A5IQL9ZEemme_wk7Csgrw"> + <children xmi:type="notation:DecorationNode" xmi:id="_58nW8L9ZEemme_wk7Csgrw" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_58nW8b9ZEemme_wk7Csgrw" x="-1" y="-30"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_58nW8r9ZEemme_wk7Csgrw" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_58n-AL9ZEemme_wk7Csgrw" x="-2" y="-14"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_58mv4b9ZEemme_wk7Csgrw" fontName="Segoe UI"/> + <element xmi:type="henshin:Edge" href="rulesDynamic.henshin#_58lhwL9ZEemme_wk7Csgrw"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_58mv4r9ZEemme_wk7Csgrw" points="[6, 0, -157, -54]$[163, 0, 0, -54]$[163, 33, 0, -21]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_58roYL9ZEemme_wk7Csgrw" id="(0.9016393442622951,0.3333333333333333)"/> + </edges> +</notation:Diagram> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin new file mode 100644 index 000000000..09d9e855e --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmi:id="_Py1cUL9aEemvZa0qyWhzpg"> + <imports href="www.boxing.com#/"/> + <units xsi:type="henshin:Rule" xmi:id="_QQH1QL9aEemvZa0qyWhzpg" name="addItemToBox"> + <lhs xmi:id="_QQQYIL9aEemvZa0qyWhzpg" name="Lhs"> + <nodes xmi:id="_Vu1gsL9aEemvZa0qyWhzpg" name="b"> + <type href="www.boxing.com#//Box"/> + </nodes> + <nodes xmi:id="_WVcNsL9aEemvZa0qyWhzpg" name="i"> + <type href="www.boxing.com#//Item"/> + </nodes> + <formula xsi:type="henshin:Not" xmi:id="_Xu_akL9aEemvZa0qyWhzpg"> + <child xsi:type="henshin:NestedCondition" xmi:id="_Xu_akb9aEemvZa0qyWhzpg"> + <conclusion xmi:id="_Xu_akr9aEemvZa0qyWhzpg"> + <nodes xmi:id="_XvABoL9aEemvZa0qyWhzpg" name="b" outgoing="_XG5f0L9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Box"/> + </nodes> + <nodes xmi:id="_XvABor9aEemvZa0qyWhzpg" name="i" incoming="_XG5f0L9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Item"/> + </nodes> + <edges xmi:id="_XG5f0L9aEemvZa0qyWhzpg" source="_XvABoL9aEemvZa0qyWhzpg" target="_XvABor9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Box/stores"/> + </edges> + </conclusion> + <mappings xmi:id="_XvABob9aEemvZa0qyWhzpg" origin="_Vu1gsL9aEemvZa0qyWhzpg" image="_XvABoL9aEemvZa0qyWhzpg"/> + <mappings xmi:id="_XvABo79aEemvZa0qyWhzpg" origin="_WVcNsL9aEemvZa0qyWhzpg" image="_XvABor9aEemvZa0qyWhzpg"/> + </child> + </formula> + </lhs> + <rhs xmi:id="_QQQYIb9aEemvZa0qyWhzpg" name="Rhs"> + <nodes xmi:id="_Vu2HwL9aEemvZa0qyWhzpg" name="b" outgoing="_YNyPYL9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Box"/> + </nodes> + <nodes xmi:id="_WVcNsb9aEemvZa0qyWhzpg" name="i" incoming="_YNyPYL9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Item"/> + </nodes> + <edges xmi:id="_YNyPYL9aEemvZa0qyWhzpg" source="_Vu2HwL9aEemvZa0qyWhzpg" target="_WVcNsb9aEemvZa0qyWhzpg"> + <type href="www.boxing.com#//Box/stores"/> + </edges> + </rhs> + <mappings xmi:id="_Vu2u0L9aEemvZa0qyWhzpg" origin="_Vu1gsL9aEemvZa0qyWhzpg" image="_Vu2HwL9aEemvZa0qyWhzpg"/> + <mappings xmi:id="_WVc0wL9aEemvZa0qyWhzpg" origin="_WVcNsL9aEemvZa0qyWhzpg" image="_WVcNsb9aEemvZa0qyWhzpg"/> + </units> +</henshin:Module> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin_diagram b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin_diagram new file mode 100644 index 000000000..485588c2a --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/rulesStatic.henshin_diagram @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_Py2DYL9aEemvZa0qyWhzpg" type="Henshin" name="rulesStatic.henshin_diagram" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_QQNU0L9aEemvZa0qyWhzpg" type="2001" fontName="Segoe UI" italic="true" lineColor="0"> + <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Vu3V4L9aEemvZa0qyWhzpg" source="defaultAction"> + <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Vu3V4b9aEemvZa0qyWhzpg" key="value" value="preserve"/> + </eAnnotations> + <children xmi:type="notation:DecorationNode" xmi:id="_QQN74L9aEemvZa0qyWhzpg" type="5001"/> + <children xmi:type="notation:DecorationNode" xmi:id="_QQN74b9aEemvZa0qyWhzpg" type="7001"> + <children xmi:type="notation:Shape" xmi:id="_Vu5yIL9aEemvZa0qyWhzpg" type="3001" fontName="Segoe UI"> + <children xmi:type="notation:DecorationNode" xmi:id="_Vu6ZML9aEemvZa0qyWhzpg" type="5002"/> + <children xmi:type="notation:DecorationNode" xmi:id="_Vu7AQL9aEemvZa0qyWhzpg" type="5003"/> + <children xmi:type="notation:DecorationNode" xmi:id="_Vu7AQb9aEemvZa0qyWhzpg" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_Vu7AQr9aEemvZa0qyWhzpg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_Vu7AQ79aEemvZa0qyWhzpg"/> + </children> + <element xmi:type="henshin:Node" href="rulesStatic.henshin#_Vu1gsL9aEemvZa0qyWhzpg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Vu5yIb9aEemvZa0qyWhzpg" x="58" y="37"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_WVep8L9aEemvZa0qyWhzpg" type="3001" fontName="Segoe UI"> + <children xmi:type="notation:DecorationNode" xmi:id="_WVfRAL9aEemvZa0qyWhzpg" type="5002"/> + <children xmi:type="notation:DecorationNode" xmi:id="_WVfRAb9aEemvZa0qyWhzpg" type="5003"/> + <children xmi:type="notation:DecorationNode" xmi:id="_WVf4EL9aEemvZa0qyWhzpg" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_WVf4Eb9aEemvZa0qyWhzpg"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_WVf4Er9aEemvZa0qyWhzpg"/> + </children> + <element xmi:type="henshin:Node" href="rulesStatic.henshin#_WVcNsL9aEemvZa0qyWhzpg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WVep8b9aEemvZa0qyWhzpg" x="249" y="88"/> + </children> + </children> + <element xmi:type="henshin:Rule" href="rulesStatic.henshin#_QQH1QL9aEemvZa0qyWhzpg"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_QQNU0b9aEemvZa0qyWhzpg" x="108" y="111" width="365"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_Py2DYb9aEemvZa0qyWhzpg"/> + <element xmi:type="henshin:Module" href="rulesStatic.henshin#_Py1cUL9aEemvZa0qyWhzpg"/> + <edges xmi:type="notation:Connector" xmi:id="_XG9KML9aEemvZa0qyWhzpg" type="4001" source="_Vu5yIL9aEemvZa0qyWhzpg" target="_WVep8L9aEemvZa0qyWhzpg"> + <children xmi:type="notation:DecorationNode" xmi:id="_XG-YUL9aEemvZa0qyWhzpg" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_XG-YUb9aEemvZa0qyWhzpg" x="-26" y="20"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_XG-YUr9aEemvZa0qyWhzpg" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_XG-_YL9aEemvZa0qyWhzpg" x="-26" y="34"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_XG9KMb9aEemvZa0qyWhzpg" fontName="Segoe UI"/> + <element xmi:type="henshin:Edge" href="rulesStatic.henshin#_XG5f0L9aEemvZa0qyWhzpg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_XG9KMr9aEemvZa0qyWhzpg" points="[0, 21, -207, -37]$[0, 58, -207, 0]$[161, 58, -46, 0]"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XHFtEL9aEemvZa0qyWhzpg" id="(0.7540983606557377,0.6666666666666666)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_YN0EkL9aEemvZa0qyWhzpg" type="4001" source="_Vu5yIL9aEemvZa0qyWhzpg" target="_WVep8L9aEemvZa0qyWhzpg"> + <children xmi:type="notation:DecorationNode" xmi:id="_YN0roL9aEemvZa0qyWhzpg" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_YN0rob9aEemvZa0qyWhzpg" x="21" y="-30"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_YN1SsL9aEemvZa0qyWhzpg" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_YN1Ssb9aEemvZa0qyWhzpg" x="18" y="-15"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_YN0Ekb9aEemvZa0qyWhzpg" fontName="Segoe UI"/> + <element xmi:type="henshin:Edge" href="rulesStatic.henshin#_YNyPYL9aEemvZa0qyWhzpg"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_YN0Ekr9aEemvZa0qyWhzpg" points="[31, -8, -161, -40]$[192, -8, 0, -40]$[192, 30, 0, -2]"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_YN6LML9aEemvZa0qyWhzpg" id="(0.5081967213114754,0.047619047619047616)"/> + </edges> +</notation:Diagram> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/simpleModel.xmi b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/simpleModel.xmi new file mode 100644 index 000000000..bacf598f1 --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/models/simpleModel.xmi @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="ASCII"?> +<boxing:Boxing xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:boxing="www.boxing.com"/> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/storedItem.xmi b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/storedItem.xmi new file mode 100644 index 000000000..de61d77cb --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/storedItem.xmi @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<boxing:Boxing + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:boxing="www.boxing.com"> + <boxes stores="//@items.0"/> + <items isStoredBy="//@boxes.0"/> +</boxing:Boxing> diff --git a/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/unstoredItem.xmi b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/unstoredItem.xmi new file mode 100644 index 000000000..22854c9ea --- /dev/null +++ b/plugins/org.eclipse.emf.henshin.examples/src/org/eclipse/emf/henshin/examples/apibasics/testModels/unstoredItem.xmi @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<boxing:Boxing xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:boxing="www.boxing.com"> + <boxes/> + <items/> +</boxing:Boxing> |