01: package org.andromda.metafacades.emf.uml2;
02:
03: import java.util.ArrayList;
04: import java.util.Collection;
05:
06: import org.eclipse.uml2.Activity;
07: import org.eclipse.uml2.State;
08:
09: /**
10: * MetafacadeLogic implementation for org.andromda.metafacades.uml.StateFacade.
11: *
12: * @see org.andromda.metafacades.uml.StateFacade
13: */
14: public class StateFacadeLogicImpl extends StateFacadeLogic {
15: public StateFacadeLogicImpl(final State metaObject,
16: final String context) {
17: super (metaObject, context);
18: }
19:
20: /**
21: * @see org.andromda.metafacades.uml.StateFacade#getDeferrableEvents()
22: */
23: protected java.util.Collection handleGetDeferrableEvents() {
24: // UML1.4 Evetns are mapped to UML2 Activity
25: // We obtains them through entry, doactivity and exit
26: Collection events = new ArrayList();
27: Activity entry = this .metaObject.getEntry();
28: Activity doActivity = this .metaObject.getDoActivity();
29: Activity onExit = this.metaObject.getExit();
30:
31: if (entry != null) {
32: events.add(entry);
33: }
34: if (doActivity != null) {
35: events.add(doActivity);
36: }
37: if (onExit != null) {
38: events.add(onExit);
39: }
40: return events;
41: }
42: }
|