1 package org.andromda.metafacades.emf.uml22;
2
3 import java.util.Collection;
4 import org.eclipse.uml2.uml.Activity;
5 import org.eclipse.uml2.uml.Element;
6 import org.eclipse.uml2.uml.Parameter;
7 import org.eclipse.uml2.uml.State;
8 import org.eclipse.uml2.uml.Transition;
9
10
11
12
13
14
15
16
17 public class EventFacadeLogicImpl
18 extends EventFacadeLogic
19 {
20 private static final long serialVersionUID = 34L;
21
22
23
24
25 public EventFacadeLogicImpl(
26 final Activity metaObject,
27 final String context)
28 {
29 super(metaObject, context);
30 }
31
32
33
34
35 @Override
36 protected Transition handleGetTransition()
37 {
38 final Element owner = this.metaObject.getOwner();
39 if (owner instanceof Transition)
40 {
41 return (Transition) owner;
42 }
43 return null;
44 }
45
46
47
48
49 @Override
50 protected Collection<Parameter> handleGetParameters()
51 {
52 return this.metaObject.getOwnedParameters();
53 }
54
55
56
57
58 @Override
59 protected State handleGetState()
60 {
61 final Element owner = this.metaObject.getOwner();
62 if (owner instanceof State)
63 {
64 return (State)owner;
65 }
66 return null;
67 }
68
69
70
71
72 @Override
73 public Object getValidationOwner()
74 {
75 Object validationOwner = this.getTransition();
76 if (validationOwner == null)
77 {
78 validationOwner = this.getState();
79 }
80 return validationOwner;
81 }
82 }