View Javadoc

1   //
2   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
3   //
4   package org.andromda.metafacades.uml14;
5   
6   /***
7    * MetafacadeLogic for org.andromda.metafacades.uml.GuardFacade
8    *
9    * @see org.andromda.metafacades.uml.GuardFacade
10   */
11  public abstract class GuardFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.GuardFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.statemachines.Guard metaObject;
17  
18      public GuardFacadeLogic(org.omg.uml.behavioralelements.statemachines.Guard metaObject, String context)
19      {
20          super(metaObject, getContext(context));
21          this.metaObject = metaObject;
22      }
23  
24      /***
25       * Gets the context for this metafacade logic instance.
26       */
27      private static String getContext(String context)
28      {
29          if (context == null)
30          {
31              context = "org.andromda.metafacades.uml.GuardFacade";
32          }
33          return context;
34      }
35  
36      /***
37       * @see org.andromda.core.metafacade.MetafacadeBase
38       */
39      public void resetMetafacadeContext(String context)
40      {
41          if (!this.contextRoot) // reset context only for non-root metafacades
42          {
43              context = getContext(context);  // to have same value as in original constructor call
44              setMetafacadeContext (context);
45          }
46      }
47  
48      /***
49       * @see org.andromda.metafacades.uml.GuardFacade
50       */
51      public boolean isGuardFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.GuardFacade#getBody()
60      */
61      protected abstract java.lang.String handleGetBody();
62  
63      private void handleGetBody1aPreCondition()
64      {
65      }
66  
67      private void handleGetBody1aPostCondition()
68      {
69      }
70  
71      public final java.lang.String getBody()
72      {
73          java.lang.String body1a = null;
74          handleGetBody1aPreCondition();
75          body1a = handleGetBody();
76          handleGetBody1aPostCondition();
77          return body1a;
78      }
79  
80      // ------------- associations ------------------
81  
82      private void handleGetTransition1rPreCondition()
83      {
84      }
85  
86      private void handleGetTransition1rPostCondition()
87      {
88      }
89  
90      public final org.andromda.metafacades.uml.TransitionFacade getTransition()
91      {
92          org.andromda.metafacades.uml.TransitionFacade getTransition1r = null;
93          handleGetTransition1rPreCondition();
94          Object result = this.shieldedElement(handleGetTransition());
95          try
96          {
97              getTransition1r = (org.andromda.metafacades.uml.TransitionFacade)result;
98          }
99          catch (ClassCastException ex)
100         {
101             // ignore since the metafacade shouldn't
102             // be set if its not of the correct type
103         }
104         handleGetTransition1rPostCondition();
105         return getTransition1r;
106     }
107 
108     protected abstract java.lang.Object handleGetTransition();
109 
110     /***
111      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
112      */
113     public void validateInvariants(java.util.Collection validationMessages)
114     {
115         super.validateInvariants(validationMessages);
116     }
117     
118     /***
119      * The property that stores the name of the metafacade.
120      */
121     private static final String NAME_PROPERTY = "name";
122     
123     /***
124      * @see java.lang.Object#toString()
125      */
126     public String toString()
127     {
128         final StringBuffer toString = new StringBuffer(this.getClass().getName());
129         toString.append("[");
130         try
131         {
132             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
133         }
134         catch (final Throwable throwable)
135         {
136             // - just ignore when the metafacade doesn't have a name property
137         }
138         toString.append("]");
139         return toString.toString();
140     }
141 }