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.ActionFacade.
09: *
10: * @see org.andromda.metafacades.uml.ActionFacade
11: */
12: public class ActionFacadeLogicImpl extends ActionFacadeLogic {
13: public ActionFacadeLogicImpl(
14: final org.eclipse.uml2.Action metaObject,
15: final String context) {
16: super (metaObject, context);
17: }
18:
19: /**
20: * @see org.andromda.metafacades.uml.ActionFacade#getTransition()
21: */
22: protected java.lang.Object handleGetTransition() {
23: final Element owner = this .metaObject.getActivity().getOwner();
24: return owner instanceof Transition ? owner : null;
25: }
26:
27: /**
28: * @see org.andromda.metafacades.uml.ActionFacade#getActionState()
29: */
30: protected java.lang.Object handleGetActionState() {
31: final Element owner = this .metaObject.getActivity().getOwner();
32: return owner instanceof State ? owner : null;
33: }
34:
35: public Object getValidationOwner() {
36: Object validationOwner = getTransition();
37:
38: if (validationOwner == null) {
39: validationOwner = getActionState();
40: }
41:
42: return validationOwner;
43: }
44: }
|