1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.GeneralizableElementFacade
8 *
9 * @see org.andromda.metafacades.uml.GeneralizableElementFacade
10 */
11 public abstract class GeneralizableElementFacadeLogic
12 extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13 implements org.andromda.metafacades.uml.GeneralizableElementFacade
14 {
15
16 protected org.omg.uml.foundation.core.GeneralizableElement metaObject;
17
18 public GeneralizableElementFacadeLogic(org.omg.uml.foundation.core.GeneralizableElement 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.GeneralizableElementFacade";
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)
42 {
43 context = getContext(context);
44 setMetafacadeContext (context);
45 }
46 }
47
48 /***
49 * @see org.andromda.metafacades.uml.GeneralizableElementFacade
50 */
51 public boolean isGeneralizableElementFacadeMetaType()
52 {
53 return true;
54 }
55
56
57
58 /***
59 * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getGeneralizationList()
60 */
61 protected abstract java.lang.String handleGetGeneralizationList();
62
63 private void handleGetGeneralizationList1aPreCondition()
64 {
65 }
66
67 private void handleGetGeneralizationList1aPostCondition()
68 {
69 }
70
71 private java.lang.String __generalizationList1a;
72 private boolean __generalizationList1aSet = false;
73
74 public final java.lang.String getGeneralizationList()
75 {
76 java.lang.String generalizationList1a = this.__generalizationList1a;
77 if (!this.__generalizationList1aSet)
78 {
79 handleGetGeneralizationList1aPreCondition();
80 generalizationList1a = handleGetGeneralizationList();
81 handleGetGeneralizationList1aPostCondition();
82 this.__generalizationList1a = generalizationList1a;
83 if (isMetafacadePropertyCachingEnabled())
84 {
85 this.__generalizationList1aSet = true;
86 }
87 }
88 return generalizationList1a;
89 }
90
91
92
93 protected abstract java.lang.Object handleFindTaggedValue(java.lang.String tagName, boolean follow);
94
95 private void handleFindTaggedValue1oPreCondition()
96 {
97 }
98
99 private void handleFindTaggedValue1oPostCondition()
100 {
101 }
102
103 public java.lang.Object findTaggedValue(java.lang.String tagName, boolean follow)
104 {
105 handleFindTaggedValue1oPreCondition();
106 java.lang.Object returnValue = handleFindTaggedValue(tagName, follow);
107 handleFindTaggedValue1oPostCondition();
108 return returnValue;
109 }
110
111
112
113 private void handleGetGeneralization1rPreCondition()
114 {
115 }
116
117 private void handleGetGeneralization1rPostCondition()
118 {
119 }
120
121 public final org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralization()
122 {
123 org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralization1r = null;
124 handleGetGeneralization1rPreCondition();
125 Object result = this.shieldedElement(handleGetGeneralization());
126 try
127 {
128 getGeneralization1r = (org.andromda.metafacades.uml.GeneralizableElementFacade)result;
129 }
130 catch (ClassCastException ex)
131 {
132
133
134 }
135 handleGetGeneralization1rPostCondition();
136 return getGeneralization1r;
137 }
138
139 protected abstract java.lang.Object handleGetGeneralization();
140
141 private void handleGetSpecializations6rPreCondition()
142 {
143 }
144
145 private void handleGetSpecializations6rPostCondition()
146 {
147 }
148
149 private java.util.Collection __getSpecializations6r;
150 private boolean __getSpecializations6rSet = false;
151
152 public final java.util.Collection getSpecializations()
153 {
154 java.util.Collection getSpecializations6r = this.__getSpecializations6r;
155 if (!this.__getSpecializations6rSet)
156 {
157 handleGetSpecializations6rPreCondition();
158 Object result = this.shieldedElements(handleGetSpecializations());
159 try
160 {
161 getSpecializations6r = (java.util.Collection)result;
162 }
163 catch (ClassCastException ex)
164 {
165
166
167 }
168 handleGetSpecializations6rPostCondition();
169 this.__getSpecializations6r = getSpecializations6r;
170 if (isMetafacadePropertyCachingEnabled())
171 {
172 this.__getSpecializations6rSet = true;
173 }
174 }
175 return getSpecializations6r;
176 }
177
178 protected abstract java.util.Collection handleGetSpecializations();
179
180 private void handleGetGeneralizations7rPreCondition()
181 {
182 }
183
184 private void handleGetGeneralizations7rPostCondition()
185 {
186 }
187
188 public final java.util.Collection getGeneralizations()
189 {
190 java.util.Collection getGeneralizations7r = null;
191 handleGetGeneralizations7rPreCondition();
192 Object result = this.shieldedElements(handleGetGeneralizations());
193 try
194 {
195 getGeneralizations7r = (java.util.Collection)result;
196 }
197 catch (ClassCastException ex)
198 {
199
200
201 }
202 handleGetGeneralizations7rPostCondition();
203 return getGeneralizations7r;
204 }
205
206 protected abstract java.util.Collection handleGetGeneralizations();
207
208 private void handleGetGeneralizationLinks9rPreCondition()
209 {
210 }
211
212 private void handleGetGeneralizationLinks9rPostCondition()
213 {
214 }
215
216 public final java.util.Collection getGeneralizationLinks()
217 {
218 java.util.Collection getGeneralizationLinks9r = null;
219 handleGetGeneralizationLinks9rPreCondition();
220 Object result = this.shieldedElements(handleGetGeneralizationLinks());
221 try
222 {
223 getGeneralizationLinks9r = (java.util.Collection)result;
224 }
225 catch (ClassCastException ex)
226 {
227
228
229 }
230 handleGetGeneralizationLinks9rPostCondition();
231 return getGeneralizationLinks9r;
232 }
233
234 protected abstract java.util.Collection handleGetGeneralizationLinks();
235
236 private void handleGetAllSpecializations10rPreCondition()
237 {
238 }
239
240 private void handleGetAllSpecializations10rPostCondition()
241 {
242 }
243
244 public final java.util.Collection getAllSpecializations()
245 {
246 java.util.Collection getAllSpecializations10r = null;
247 handleGetAllSpecializations10rPreCondition();
248 Object result = this.shieldedElements(handleGetAllSpecializations());
249 try
250 {
251 getAllSpecializations10r = (java.util.Collection)result;
252 }
253 catch (ClassCastException ex)
254 {
255
256
257 }
258 handleGetAllSpecializations10rPostCondition();
259 return getAllSpecializations10r;
260 }
261
262 protected abstract java.util.Collection handleGetAllSpecializations();
263
264 private void handleGetAllGeneralizations12rPreCondition()
265 {
266 }
267
268 private void handleGetAllGeneralizations12rPostCondition()
269 {
270 }
271
272 public final java.util.Collection getAllGeneralizations()
273 {
274 java.util.Collection getAllGeneralizations12r = null;
275 handleGetAllGeneralizations12rPreCondition();
276 Object result = this.shieldedElements(handleGetAllGeneralizations());
277 try
278 {
279 getAllGeneralizations12r = (java.util.Collection)result;
280 }
281 catch (ClassCastException ex)
282 {
283
284
285 }
286 handleGetAllGeneralizations12rPostCondition();
287 return getAllGeneralizations12r;
288 }
289
290 protected abstract java.util.Collection handleGetAllGeneralizations();
291
292 private void handleGetGeneralizationRoot14rPreCondition()
293 {
294 }
295
296 private void handleGetGeneralizationRoot14rPostCondition()
297 {
298 }
299
300 private org.andromda.metafacades.uml.GeneralizableElementFacade __getGeneralizationRoot14r;
301 private boolean __getGeneralizationRoot14rSet = false;
302
303 public final org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralizationRoot()
304 {
305 org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralizationRoot14r = this.__getGeneralizationRoot14r;
306 if (!this.__getGeneralizationRoot14rSet)
307 {
308 handleGetGeneralizationRoot14rPreCondition();
309 Object result = this.shieldedElement(handleGetGeneralizationRoot());
310 try
311 {
312 getGeneralizationRoot14r = (org.andromda.metafacades.uml.GeneralizableElementFacade)result;
313 }
314 catch (ClassCastException ex)
315 {
316
317
318 }
319 handleGetGeneralizationRoot14rPostCondition();
320 this.__getGeneralizationRoot14r = getGeneralizationRoot14r;
321 if (isMetafacadePropertyCachingEnabled())
322 {
323 this.__getGeneralizationRoot14rSet = true;
324 }
325 }
326 return getGeneralizationRoot14r;
327 }
328
329 protected abstract java.lang.Object handleGetGeneralizationRoot();
330
331 /***
332 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
333 */
334 public void validateInvariants(java.util.Collection validationMessages)
335 {
336 super.validateInvariants(validationMessages);
337 }
338
339 /***
340 * The property that stores the name of the metafacade.
341 */
342 private static final String NAME_PROPERTY = "name";
343
344 /***
345 * @see java.lang.Object#toString()
346 */
347 public String toString()
348 {
349 final StringBuffer toString = new StringBuffer(this.getClass().getName());
350 toString.append("[");
351 try
352 {
353 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
354 }
355 catch (final Throwable throwable)
356 {
357
358 }
359 toString.append("]");
360 return toString.toString();
361 }
362 }