View Javadoc
1   package org.andromda.metafacades.emf.uml22;
2   
3   import org.eclipse.uml2.uml.Constraint;
4   import org.eclipse.uml2.uml.Element;
5   import org.eclipse.uml2.uml.Transition;
6   
7   /**
8    * MetafacadeLogic implementation for org.andromda.metafacades.uml.GuardFacade.
9    *
10   * @see org.andromda.metafacades.uml.GuardFacade
11   */
12  public class GuardFacadeLogicImpl
13      extends GuardFacadeLogic
14  {
15      private static final long serialVersionUID = 34L;
16      /**
17       * @param metaObject
18       * @param context
19       */
20      public GuardFacadeLogicImpl(
21          final Constraint metaObject,
22          final String context)
23      {
24          super(metaObject, context);
25      }
26  
27      /**
28       * @see org.andromda.metafacades.uml.GuardFacade#getBody()
29       */
30      @Override
31      protected String handleGetBody()
32      {
33          String body = null;
34          if (this.metaObject.getSpecification() != null)
35          {
36              body = this.metaObject.getSpecification().stringValue();
37          }
38          return body;
39      }
40  
41      /**
42       * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
43       */
44      @Override
45      public Object getValidationOwner()
46      {
47          return getTransition();
48      }
49  
50      /**
51       * @see org.andromda.metafacades.uml.GuardFacade#getTransition()
52       */
53      @Override
54      protected Transition handleGetTransition()
55      {
56          final Element owner = this.metaObject.getOwner();
57          if (owner instanceof Transition)
58          {
59              return (Transition)owner;
60          }
61          return null;
62      }
63  }