01: package org.andromda.metafacades.emf.uml2;
02:
03: import org.eclipse.uml2.Constraint;
04: import org.eclipse.uml2.Element;
05: import org.eclipse.uml2.Transition;
06:
07: /**
08: * MetafacadeLogic implementation for org.andromda.metafacades.uml.GuardFacade.
09: *
10: * @see org.andromda.metafacades.uml.GuardFacade
11: */
12: public class GuardFacadeLogicImpl extends GuardFacadeLogic {
13: public GuardFacadeLogicImpl(final Constraint metaObject,
14: final String context) {
15: super (metaObject, context);
16: }
17:
18: /**
19: * @see org.andromda.metafacades.uml.GuardFacade#getBody()
20: */
21: protected java.lang.String handleGetBody() {
22: String body = null;
23: if (this .metaObject.getSpecification() != null) {
24: body = this .metaObject.getSpecification().stringValue();
25: }
26: return body;
27: }
28:
29: public Object getValidationOwner() {
30: return getTransition();
31: }
32:
33: /**
34: * @see org.andromda.metafacades.uml.GuardFacade#getTransition()
35: */
36: protected java.lang.Object handleGetTransition() {
37: Element owner = this .metaObject.getOwner();
38: if (owner instanceof Transition) {
39: return owner;
40: }
41: return null;
42: }
43: }
|