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.ConstraintFacade
8    *
9    * @see org.andromda.metafacades.uml.ConstraintFacade
10   */
11  public abstract class ConstraintFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ConstraintFacade
14  {
15  
16      protected org.omg.uml.foundation.core.Constraint metaObject;
17  
18      public ConstraintFacadeLogic(org.omg.uml.foundation.core.Constraint 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.ConstraintFacade";
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.ConstraintFacade
50       */
51      public boolean isConstraintFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.ConstraintFacade#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      private java.lang.String __body1a;
72      private boolean __body1aSet = false;
73  
74      public final java.lang.String getBody()
75      {
76          java.lang.String body1a = this.__body1a;
77          if (!this.__body1aSet)
78          {
79              handleGetBody1aPreCondition();
80              body1a = handleGetBody();
81              handleGetBody1aPostCondition();
82              this.__body1a = body1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__body1aSet = true;
86              }
87          }
88          return body1a;
89      }
90  
91     /***
92      * @see org.andromda.metafacades.uml.ConstraintFacade#isInvariant()
93      */
94      protected abstract boolean handleIsInvariant();
95  
96      private void handleIsInvariant2aPreCondition()
97      {
98      }
99  
100     private void handleIsInvariant2aPostCondition()
101     {
102     }
103 
104     private boolean __invariant2a;
105     private boolean __invariant2aSet = false;
106 
107     public final boolean isInvariant()
108     {
109         boolean invariant2a = this.__invariant2a;
110         if (!this.__invariant2aSet)
111         {
112             handleIsInvariant2aPreCondition();
113             invariant2a = handleIsInvariant();
114             handleIsInvariant2aPostCondition();
115             this.__invariant2a = invariant2a;
116             if (isMetafacadePropertyCachingEnabled())
117             {
118                 this.__invariant2aSet = true;
119             }
120         }
121         return invariant2a;
122     }
123 
124    /***
125     * @see org.andromda.metafacades.uml.ConstraintFacade#isPreCondition()
126     */
127     protected abstract boolean handleIsPreCondition();
128 
129     private void handleIsPreCondition3aPreCondition()
130     {
131     }
132 
133     private void handleIsPreCondition3aPostCondition()
134     {
135     }
136 
137     private boolean __preCondition3a;
138     private boolean __preCondition3aSet = false;
139 
140     public final boolean isPreCondition()
141     {
142         boolean preCondition3a = this.__preCondition3a;
143         if (!this.__preCondition3aSet)
144         {
145             handleIsPreCondition3aPreCondition();
146             preCondition3a = handleIsPreCondition();
147             handleIsPreCondition3aPostCondition();
148             this.__preCondition3a = preCondition3a;
149             if (isMetafacadePropertyCachingEnabled())
150             {
151                 this.__preCondition3aSet = true;
152             }
153         }
154         return preCondition3a;
155     }
156 
157    /***
158     * @see org.andromda.metafacades.uml.ConstraintFacade#isPostCondition()
159     */
160     protected abstract boolean handleIsPostCondition();
161 
162     private void handleIsPostCondition4aPreCondition()
163     {
164     }
165 
166     private void handleIsPostCondition4aPostCondition()
167     {
168     }
169 
170     private boolean __postCondition4a;
171     private boolean __postCondition4aSet = false;
172 
173     public final boolean isPostCondition()
174     {
175         boolean postCondition4a = this.__postCondition4a;
176         if (!this.__postCondition4aSet)
177         {
178             handleIsPostCondition4aPreCondition();
179             postCondition4a = handleIsPostCondition();
180             handleIsPostCondition4aPostCondition();
181             this.__postCondition4a = postCondition4a;
182             if (isMetafacadePropertyCachingEnabled())
183             {
184                 this.__postCondition4aSet = true;
185             }
186         }
187         return postCondition4a;
188     }
189 
190    /***
191     * @see org.andromda.metafacades.uml.ConstraintFacade#isDefinition()
192     */
193     protected abstract boolean handleIsDefinition();
194 
195     private void handleIsDefinition5aPreCondition()
196     {
197     }
198 
199     private void handleIsDefinition5aPostCondition()
200     {
201     }
202 
203     private boolean __definition5a;
204     private boolean __definition5aSet = false;
205 
206     public final boolean isDefinition()
207     {
208         boolean definition5a = this.__definition5a;
209         if (!this.__definition5aSet)
210         {
211             handleIsDefinition5aPreCondition();
212             definition5a = handleIsDefinition();
213             handleIsDefinition5aPostCondition();
214             this.__definition5a = definition5a;
215             if (isMetafacadePropertyCachingEnabled())
216             {
217                 this.__definition5aSet = true;
218             }
219         }
220         return definition5a;
221     }
222 
223    /***
224     * @see org.andromda.metafacades.uml.ConstraintFacade#isBodyExpression()
225     */
226     protected abstract boolean handleIsBodyExpression();
227 
228     private void handleIsBodyExpression6aPreCondition()
229     {
230     }
231 
232     private void handleIsBodyExpression6aPostCondition()
233     {
234     }
235 
236     private boolean __bodyExpression6a;
237     private boolean __bodyExpression6aSet = false;
238 
239     public final boolean isBodyExpression()
240     {
241         boolean bodyExpression6a = this.__bodyExpression6a;
242         if (!this.__bodyExpression6aSet)
243         {
244             handleIsBodyExpression6aPreCondition();
245             bodyExpression6a = handleIsBodyExpression();
246             handleIsBodyExpression6aPostCondition();
247             this.__bodyExpression6a = bodyExpression6a;
248             if (isMetafacadePropertyCachingEnabled())
249             {
250                 this.__bodyExpression6aSet = true;
251             }
252         }
253         return bodyExpression6a;
254     }
255 
256     // ---------------- business methods ----------------------
257 
258     protected abstract java.lang.String handleGetTranslation(java.lang.String language);
259 
260     private void handleGetTranslation1oPreCondition()
261     {
262     }
263 
264     private void handleGetTranslation1oPostCondition()
265     {
266     }
267 
268     public java.lang.String getTranslation(java.lang.String language)
269     {
270         handleGetTranslation1oPreCondition();
271         java.lang.String returnValue = handleGetTranslation(language);
272         handleGetTranslation1oPostCondition();
273         return returnValue;
274     }
275 
276     // ------------- associations ------------------
277 
278     private void handleGetContextElement1rPreCondition()
279     {
280     }
281 
282     private void handleGetContextElement1rPostCondition()
283     {
284     }
285 
286     public final org.andromda.metafacades.uml.ModelElementFacade getContextElement()
287     {
288         org.andromda.metafacades.uml.ModelElementFacade getContextElement1r = null;
289         handleGetContextElement1rPreCondition();
290         Object result = this.shieldedElement(handleGetContextElement());
291         try
292         {
293             getContextElement1r = (org.andromda.metafacades.uml.ModelElementFacade)result;
294         }
295         catch (ClassCastException ex)
296         {
297             // ignore since the metafacade shouldn't
298             // be set if its not of the correct type
299         }
300         handleGetContextElement1rPostCondition();
301         return getContextElement1r;
302     }
303 
304     protected abstract java.lang.Object handleGetContextElement();
305 
306     /***
307      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
308      */
309     public void validateInvariants(java.util.Collection validationMessages)
310     {
311         super.validateInvariants(validationMessages);
312     }
313     
314     /***
315      * The property that stores the name of the metafacade.
316      */
317     private static final String NAME_PROPERTY = "name";
318     
319     /***
320      * @see java.lang.Object#toString()
321      */
322     public String toString()
323     {
324         final StringBuffer toString = new StringBuffer(this.getClass().getName());
325         toString.append("[");
326         try
327         {
328             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
329         }
330         catch (final Throwable throwable)
331         {
332             // - just ignore when the metafacade doesn't have a name property
333         }
334         toString.append("]");
335         return toString.toString();
336     }
337 }