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.EntityAttribute
8    *
9    * @see org.andromda.metafacades.uml.EntityAttribute
10   */
11  public abstract class EntityAttributeLogic
12      extends org.andromda.metafacades.uml14.AttributeFacadeLogicImpl
13      implements org.andromda.metafacades.uml.EntityAttribute
14  {
15  
16      protected Object metaObject;
17  
18      public EntityAttributeLogic(Object metaObject, String context)
19      {
20          super((org.omg.uml.foundation.core.Attribute)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.EntityAttribute";
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.EntityAttribute
50       */
51      public boolean isEntityAttributeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.EntityAttribute#getColumnLength()
60      */
61      protected abstract java.lang.String handleGetColumnLength();
62  
63      private void handleGetColumnLength1aPreCondition()
64      {
65      }
66  
67      private void handleGetColumnLength1aPostCondition()
68      {
69      }
70  
71      private java.lang.String __columnLength1a;
72      private boolean __columnLength1aSet = false;
73  
74      public final java.lang.String getColumnLength()
75      {
76          java.lang.String columnLength1a = this.__columnLength1a;
77          if (!this.__columnLength1aSet)
78          {
79              handleGetColumnLength1aPreCondition();
80              columnLength1a = handleGetColumnLength();
81              handleGetColumnLength1aPostCondition();
82              this.__columnLength1a = columnLength1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__columnLength1aSet = true;
86              }
87          }
88          return columnLength1a;
89      }
90  
91     /***
92      * @see org.andromda.metafacades.uml.EntityAttribute#getColumnName()
93      */
94      protected abstract java.lang.String handleGetColumnName();
95  
96      private void handleGetColumnName2aPreCondition()
97      {
98      }
99  
100     private void handleGetColumnName2aPostCondition()
101     {
102     }
103 
104     private java.lang.String __columnName2a;
105     private boolean __columnName2aSet = false;
106 
107     public final java.lang.String getColumnName()
108     {
109         java.lang.String columnName2a = this.__columnName2a;
110         if (!this.__columnName2aSet)
111         {
112             handleGetColumnName2aPreCondition();
113             columnName2a = handleGetColumnName();
114             handleGetColumnName2aPostCondition();
115             this.__columnName2a = columnName2a;
116             if (isMetafacadePropertyCachingEnabled())
117             {
118                 this.__columnName2aSet = true;
119             }
120         }
121         return columnName2a;
122     }
123 
124    /***
125     * @see org.andromda.metafacades.uml.EntityAttribute#getJdbcMappings()
126     */
127     protected abstract org.andromda.metafacades.uml.TypeMappings handleGetJdbcMappings();
128 
129     private void handleGetJdbcMappings3aPreCondition()
130     {
131     }
132 
133     private void handleGetJdbcMappings3aPostCondition()
134     {
135     }
136 
137     private org.andromda.metafacades.uml.TypeMappings __jdbcMappings3a;
138     private boolean __jdbcMappings3aSet = false;
139 
140     public final org.andromda.metafacades.uml.TypeMappings getJdbcMappings()
141     {
142         org.andromda.metafacades.uml.TypeMappings jdbcMappings3a = this.__jdbcMappings3a;
143         if (!this.__jdbcMappings3aSet)
144         {
145             handleGetJdbcMappings3aPreCondition();
146             jdbcMappings3a = handleGetJdbcMappings();
147             handleGetJdbcMappings3aPostCondition();
148             this.__jdbcMappings3a = jdbcMappings3a;
149             if (isMetafacadePropertyCachingEnabled())
150             {
151                 this.__jdbcMappings3aSet = true;
152             }
153         }
154         return jdbcMappings3a;
155     }
156 
157    /***
158     * @see org.andromda.metafacades.uml.EntityAttribute#getJdbcType()
159     */
160     protected abstract java.lang.String handleGetJdbcType();
161 
162     private void handleGetJdbcType4aPreCondition()
163     {
164     }
165 
166     private void handleGetJdbcType4aPostCondition()
167     {
168     }
169 
170     private java.lang.String __jdbcType4a;
171     private boolean __jdbcType4aSet = false;
172 
173     public final java.lang.String getJdbcType()
174     {
175         java.lang.String jdbcType4a = this.__jdbcType4a;
176         if (!this.__jdbcType4aSet)
177         {
178             handleGetJdbcType4aPreCondition();
179             jdbcType4a = handleGetJdbcType();
180             handleGetJdbcType4aPostCondition();
181             this.__jdbcType4a = jdbcType4a;
182             if (isMetafacadePropertyCachingEnabled())
183             {
184                 this.__jdbcType4aSet = true;
185             }
186         }
187         return jdbcType4a;
188     }
189 
190    /***
191     * @see org.andromda.metafacades.uml.EntityAttribute#getSqlMappings()
192     */
193     protected abstract org.andromda.metafacades.uml.TypeMappings handleGetSqlMappings();
194 
195     private void handleGetSqlMappings5aPreCondition()
196     {
197     }
198 
199     private void handleGetSqlMappings5aPostCondition()
200     {
201     }
202 
203     private org.andromda.metafacades.uml.TypeMappings __sqlMappings5a;
204     private boolean __sqlMappings5aSet = false;
205 
206     public final org.andromda.metafacades.uml.TypeMappings getSqlMappings()
207     {
208         org.andromda.metafacades.uml.TypeMappings sqlMappings5a = this.__sqlMappings5a;
209         if (!this.__sqlMappings5aSet)
210         {
211             handleGetSqlMappings5aPreCondition();
212             sqlMappings5a = handleGetSqlMappings();
213             handleGetSqlMappings5aPostCondition();
214             this.__sqlMappings5a = sqlMappings5a;
215             if (isMetafacadePropertyCachingEnabled())
216             {
217                 this.__sqlMappings5aSet = true;
218             }
219         }
220         return sqlMappings5a;
221     }
222 
223    /***
224     * @see org.andromda.metafacades.uml.EntityAttribute#getSqlType()
225     */
226     protected abstract java.lang.String handleGetSqlType();
227 
228     private void handleGetSqlType6aPreCondition()
229     {
230     }
231 
232     private void handleGetSqlType6aPostCondition()
233     {
234     }
235 
236     private java.lang.String __sqlType6a;
237     private boolean __sqlType6aSet = false;
238 
239     public final java.lang.String getSqlType()
240     {
241         java.lang.String sqlType6a = this.__sqlType6a;
242         if (!this.__sqlType6aSet)
243         {
244             handleGetSqlType6aPreCondition();
245             sqlType6a = handleGetSqlType();
246             handleGetSqlType6aPostCondition();
247             this.__sqlType6a = sqlType6a;
248             if (isMetafacadePropertyCachingEnabled())
249             {
250                 this.__sqlType6aSet = true;
251             }
252         }
253         return sqlType6a;
254     }
255 
256    /***
257     * @see org.andromda.metafacades.uml.EntityAttribute#isIdentifier()
258     */
259     protected abstract boolean handleIsIdentifier();
260 
261     private void handleIsIdentifier7aPreCondition()
262     {
263     }
264 
265     private void handleIsIdentifier7aPostCondition()
266     {
267     }
268 
269     private boolean __identifier7a;
270     private boolean __identifier7aSet = false;
271 
272     public final boolean isIdentifier()
273     {
274         boolean identifier7a = this.__identifier7a;
275         if (!this.__identifier7aSet)
276         {
277             handleIsIdentifier7aPreCondition();
278             identifier7a = handleIsIdentifier();
279             handleIsIdentifier7aPostCondition();
280             this.__identifier7a = identifier7a;
281             if (isMetafacadePropertyCachingEnabled())
282             {
283                 this.__identifier7aSet = true;
284             }
285         }
286         return identifier7a;
287     }
288 
289    /***
290     * @see org.andromda.metafacades.uml.EntityAttribute#isUnique()
291     */
292     protected abstract boolean handleIsUnique();
293 
294     private void handleIsUnique8aPreCondition()
295     {
296     }
297 
298     private void handleIsUnique8aPostCondition()
299     {
300     }
301 
302     private boolean __unique8a;
303     private boolean __unique8aSet = false;
304 
305     public final boolean isUnique()
306     {
307         boolean unique8a = this.__unique8a;
308         if (!this.__unique8aSet)
309         {
310             handleIsUnique8aPreCondition();
311             unique8a = handleIsUnique();
312             handleIsUnique8aPostCondition();
313             this.__unique8a = unique8a;
314             if (isMetafacadePropertyCachingEnabled())
315             {
316                 this.__unique8aSet = true;
317             }
318         }
319         return unique8a;
320     }
321 
322    /***
323     * @see org.andromda.metafacades.uml.EntityAttribute#getColumnIndex()
324     */
325     protected abstract java.lang.String handleGetColumnIndex();
326 
327     private void handleGetColumnIndex9aPreCondition()
328     {
329     }
330 
331     private void handleGetColumnIndex9aPostCondition()
332     {
333     }
334 
335     private java.lang.String __columnIndex9a;
336     private boolean __columnIndex9aSet = false;
337 
338     public final java.lang.String getColumnIndex()
339     {
340         java.lang.String columnIndex9a = this.__columnIndex9a;
341         if (!this.__columnIndex9aSet)
342         {
343             handleGetColumnIndex9aPreCondition();
344             columnIndex9a = handleGetColumnIndex();
345             handleGetColumnIndex9aPostCondition();
346             this.__columnIndex9a = columnIndex9a;
347             if (isMetafacadePropertyCachingEnabled())
348             {
349                 this.__columnIndex9aSet = true;
350             }
351         }
352         return columnIndex9a;
353     }
354 
355    /***
356     * @see org.andromda.metafacades.uml.EntityAttribute#isTransient()
357     */
358     protected abstract boolean handleIsTransient();
359 
360     private void handleIsTransient10aPreCondition()
361     {
362     }
363 
364     private void handleIsTransient10aPostCondition()
365     {
366     }
367 
368     private boolean __transient10a;
369     private boolean __transient10aSet = false;
370 
371     public final boolean isTransient()
372     {
373         boolean transient10a = this.__transient10a;
374         if (!this.__transient10aSet)
375         {
376             handleIsTransient10aPreCondition();
377             transient10a = handleIsTransient();
378             handleIsTransient10aPostCondition();
379             this.__transient10a = transient10a;
380             if (isMetafacadePropertyCachingEnabled())
381             {
382                 this.__transient10aSet = true;
383             }
384         }
385         return transient10a;
386     }
387 
388    /***
389     * @see org.andromda.metafacades.uml.EntityAttribute#getUniqueGroup()
390     */
391     protected abstract java.lang.String handleGetUniqueGroup();
392 
393     private void handleGetUniqueGroup11aPreCondition()
394     {
395     }
396 
397     private void handleGetUniqueGroup11aPostCondition()
398     {
399     }
400 
401     private java.lang.String __uniqueGroup11a;
402     private boolean __uniqueGroup11aSet = false;
403 
404     public final java.lang.String getUniqueGroup()
405     {
406         java.lang.String uniqueGroup11a = this.__uniqueGroup11a;
407         if (!this.__uniqueGroup11aSet)
408         {
409             handleGetUniqueGroup11aPreCondition();
410             uniqueGroup11a = handleGetUniqueGroup();
411             handleGetUniqueGroup11aPostCondition();
412             this.__uniqueGroup11a = uniqueGroup11a;
413             if (isMetafacadePropertyCachingEnabled())
414             {
415                 this.__uniqueGroup11aSet = true;
416             }
417         }
418         return uniqueGroup11a;
419     }
420 
421     // ------------- associations ------------------
422 
423     /***
424      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
425      */
426     public void validateInvariants(java.util.Collection validationMessages)
427     {
428         super.validateInvariants(validationMessages);
429     }
430     
431     /***
432      * The property that stores the name of the metafacade.
433      */
434     private static final String NAME_PROPERTY = "name";
435     
436     /***
437      * @see java.lang.Object#toString()
438      */
439     public String toString()
440     {
441         final StringBuffer toString = new StringBuffer(this.getClass().getName());
442         toString.append("[");
443         try
444         {
445             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
446         }
447         catch (final Throwable throwable)
448         {
449             // - just ignore when the metafacade doesn't have a name property
450         }
451         toString.append("]");
452         return toString.toString();
453     }
454 }