01: package org.andromda.metafacades.emf.uml2;
02:
03: import org.eclipse.uml2.Element;
04: import org.eclipse.uml2.State;
05: import org.eclipse.uml2.Transition;
06:
07: /**
08: * MetafacadeLogic implementation for org.andromda.metafacades.uml.EventFacade.
09: * UML1.4 Event are mapped to UML2 Activity (because UML2 Event doesn't contain
10: * parameter)
11: *
12: * @see org.andromda.metafacades.uml.EventFacade
13: */
14: public class EventFacadeLogicImpl extends EventFacadeLogic {
15: public EventFacadeLogicImpl(
16: final org.eclipse.uml2.Activity metaObject,
17: final String context) {
18: super (metaObject, context);
19: }
20:
21: /**
22: * @see org.andromda.metafacades.uml.EventFacade#getTransition()
23: */
24: protected java.lang.Object handleGetTransition() {
25: Element owner = this .metaObject.getOwner();
26: if (owner instanceof Transition) {
27: return owner;
28: }
29: return null;
30: }
31:
32: /**
33: * @see org.andromda.metafacades.uml.EventFacade#getParameters()
34: */
35: protected java.util.Collection handleGetParameters() {
36: return this .metaObject.getParameters();
37: }
38:
39: /**
40: * @see org.andromda.metafacades.uml.EventFacade#getState()
41: */
42: protected java.lang.Object handleGetState() {
43: Element owner = this .metaObject.getOwner();
44: if (owner instanceof State) {
45: return owner;
46: }
47: return null;
48: }
49:
50: /**
51: * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
52: */
53: public Object getValidationOwner() {
54: Object validationOwner = this.getTransition();
55: if (validationOwner == null) {
56: validationOwner = this.getState();
57: }
58: return validationOwner;
59: }
60: }
|