1
2
3
4 package org.andromda.cartridges.meta.metafacades;
5
6 /***
7 * MetafacadeLogic for org.andromda.cartridges.meta.metafacades.MetafacadeAttribute
8 *
9 * @see org.andromda.cartridges.meta.metafacades.MetafacadeAttribute
10 */
11 public abstract class MetafacadeAttributeLogic
12 extends org.andromda.core.metafacade.MetafacadeBase
13 implements org.andromda.cartridges.meta.metafacades.MetafacadeAttribute
14 {
15
16 protected Object metaObject;
17
18 public MetafacadeAttributeLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.superAttributeFacade =
22 (org.andromda.metafacades.uml.AttributeFacade)
23 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24 "org.andromda.metafacades.uml.AttributeFacade",
25 metaObject,
26 getContext(context));
27 this.metaObject = metaObject;
28 }
29
30 /***
31 * Gets the context for this metafacade logic instance.
32 */
33 private static String getContext(String context)
34 {
35 if (context == null)
36 {
37 context = "org.andromda.cartridges.meta.metafacades.MetafacadeAttribute";
38 }
39 return context;
40 }
41
42 private org.andromda.metafacades.uml.AttributeFacade superAttributeFacade;
43 private boolean superAttributeFacadeInitialized = false;
44
45 /***
46 * Gets the org.andromda.metafacades.uml.AttributeFacade parent instance.
47 */
48 private org.andromda.metafacades.uml.AttributeFacade getSuperAttributeFacade()
49 {
50 if (!this.superAttributeFacadeInitialized)
51 {
52 ((org.andromda.core.metafacade.MetafacadeBase)superAttributeFacade).setMetafacadeContext(this.getMetafacadeContext());
53 this.superAttributeFacadeInitialized = true;
54 }
55 return superAttributeFacade;
56 }
57
58 /***
59 * @see org.andromda.core.metafacade.MetafacadeBase
60 */
61 public void resetMetafacadeContext(String context)
62 {
63 if (!this.contextRoot)
64 {
65 context = getContext(context);
66 setMetafacadeContext (context);
67 if (this.superAttributeFacadeInitialized)
68 {
69 ((org.andromda.core.metafacade.MetafacadeBase)superAttributeFacade).resetMetafacadeContext(context);
70 }
71 }
72 }
73
74 /***
75 * @see org.andromda.cartridges.meta.metafacades.MetafacadeAttribute
76 */
77 public boolean isMetafacadeAttributeMetaType()
78 {
79 return true;
80 }
81
82
83
84 /***
85 * @see org.andromda.cartridges.meta.metafacades.MetafacadeAttribute#getImplementationOperationName()
86 */
87 protected abstract java.lang.String handleGetImplementationOperationName();
88
89 private void handleGetImplementationOperationName1aPreCondition()
90 {
91 }
92
93 private void handleGetImplementationOperationName1aPostCondition()
94 {
95 }
96
97 private java.lang.String __implementationOperationName1a;
98 private boolean __implementationOperationName1aSet = false;
99
100 public final java.lang.String getImplementationOperationName()
101 {
102 java.lang.String implementationOperationName1a = this.__implementationOperationName1a;
103 if (!this.__implementationOperationName1aSet)
104 {
105 handleGetImplementationOperationName1aPreCondition();
106 implementationOperationName1a = handleGetImplementationOperationName();
107 handleGetImplementationOperationName1aPostCondition();
108 this.__implementationOperationName1a = implementationOperationName1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__implementationOperationName1aSet = true;
112 }
113 }
114 return implementationOperationName1a;
115 }
116
117 /***
118 * @see org.andromda.metafacades.uml.AttributeFacade
119 */
120 public boolean isAttributeFacadeMetaType()
121 {
122 return true;
123 }
124
125 /***
126 * @see org.andromda.metafacades.uml.ModelElementFacade
127 */
128 public boolean isModelElementFacadeMetaType()
129 {
130 return true;
131 }
132
133
134
135 public java.lang.Object findTaggedValue(java.lang.String name, boolean follow)
136 {
137 return this.getSuperAttributeFacade().findTaggedValue(name, follow);
138 }
139
140
141 public java.lang.String getDefaultValue()
142 {
143 return this.getSuperAttributeFacade().getDefaultValue();
144 }
145
146
147 public org.andromda.metafacades.uml.EnumerationFacade getEnumeration()
148 {
149 return this.getSuperAttributeFacade().getEnumeration();
150 }
151
152
153 public java.lang.String getEnumerationLiteralParameters()
154 {
155 return this.getSuperAttributeFacade().getEnumerationLiteralParameters();
156 }
157
158
159 public java.lang.String getEnumerationValue()
160 {
161 return this.getSuperAttributeFacade().getEnumerationValue();
162 }
163
164
165 public java.lang.String getGetterName()
166 {
167 return this.getSuperAttributeFacade().getGetterName();
168 }
169
170
171 public java.lang.String getGetterSetterTypeName()
172 {
173 return this.getSuperAttributeFacade().getGetterSetterTypeName();
174 }
175
176
177 public int getLower()
178 {
179 return this.getSuperAttributeFacade().getLower();
180 }
181
182
183 public org.andromda.metafacades.uml.ClassifierFacade getOwner()
184 {
185 return this.getSuperAttributeFacade().getOwner();
186 }
187
188
189 public java.lang.String getSetterName()
190 {
191 return this.getSuperAttributeFacade().getSetterName();
192 }
193
194
195 public org.andromda.metafacades.uml.ClassifierFacade getType()
196 {
197 return this.getSuperAttributeFacade().getType();
198 }
199
200
201 public int getUpper()
202 {
203 return this.getSuperAttributeFacade().getUpper();
204 }
205
206
207 public boolean isAddOnly()
208 {
209 return this.getSuperAttributeFacade().isAddOnly();
210 }
211
212
213 public boolean isChangeable()
214 {
215 return this.getSuperAttributeFacade().isChangeable();
216 }
217
218
219 public boolean isDefaultValuePresent()
220 {
221 return this.getSuperAttributeFacade().isDefaultValuePresent();
222 }
223
224
225 public boolean isEnumerationLiteral()
226 {
227 return this.getSuperAttributeFacade().isEnumerationLiteral();
228 }
229
230
231 public boolean isEnumerationLiteralParametersExist()
232 {
233 return this.getSuperAttributeFacade().isEnumerationLiteralParametersExist();
234 }
235
236
237 public boolean isEnumerationMember()
238 {
239 return this.getSuperAttributeFacade().isEnumerationMember();
240 }
241
242
243 public boolean isMany()
244 {
245 return this.getSuperAttributeFacade().isMany();
246 }
247
248
249 public boolean isOrdered()
250 {
251 return this.getSuperAttributeFacade().isOrdered();
252 }
253
254
255 public boolean isReadOnly()
256 {
257 return this.getSuperAttributeFacade().isReadOnly();
258 }
259
260
261 public boolean isRequired()
262 {
263 return this.getSuperAttributeFacade().isRequired();
264 }
265
266
267 public boolean isStatic()
268 {
269 return this.getSuperAttributeFacade().isStatic();
270 }
271
272
273 public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
274 {
275 this.getSuperAttributeFacade().copyTaggedValues(element);
276 }
277
278
279 public java.lang.Object findTaggedValue(java.lang.String tagName)
280 {
281 return this.getSuperAttributeFacade().findTaggedValue(tagName);
282 }
283
284
285 public java.util.Collection findTaggedValues(java.lang.String tagName)
286 {
287 return this.getSuperAttributeFacade().findTaggedValues(tagName);
288 }
289
290
291 public java.util.Collection getConstraints()
292 {
293 return this.getSuperAttributeFacade().getConstraints();
294 }
295
296
297 public java.util.Collection getConstraints(java.lang.String kind)
298 {
299 return this.getSuperAttributeFacade().getConstraints(kind);
300 }
301
302
303 public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
304 {
305 return this.getSuperAttributeFacade().getDocumentation(indent, lineLength);
306 }
307
308
309 public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
310 {
311 return this.getSuperAttributeFacade().getDocumentation(indent, lineLength, htmlStyle);
312 }
313
314
315 public java.lang.String getDocumentation(java.lang.String indent)
316 {
317 return this.getSuperAttributeFacade().getDocumentation(indent);
318 }
319
320
321 public java.lang.String getFullyQualifiedName(boolean modelName)
322 {
323 return this.getSuperAttributeFacade().getFullyQualifiedName(modelName);
324 }
325
326
327 public java.lang.String getFullyQualifiedName()
328 {
329 return this.getSuperAttributeFacade().getFullyQualifiedName();
330 }
331
332
333 public java.lang.String getFullyQualifiedNamePath()
334 {
335 return this.getSuperAttributeFacade().getFullyQualifiedNamePath();
336 }
337
338
339 public java.lang.String getId()
340 {
341 return this.getSuperAttributeFacade().getId();
342 }
343
344
345 public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
346 {
347 return this.getSuperAttributeFacade().getLanguageMappings();
348 }
349
350
351 public org.andromda.metafacades.uml.ModelFacade getModel()
352 {
353 return this.getSuperAttributeFacade().getModel();
354 }
355
356
357 public java.lang.String getName()
358 {
359 return this.getSuperAttributeFacade().getName();
360 }
361
362
363 public org.andromda.metafacades.uml.ModelElementFacade getPackage()
364 {
365 return this.getSuperAttributeFacade().getPackage();
366 }
367
368
369 public java.lang.String getPackageName(boolean modelName)
370 {
371 return this.getSuperAttributeFacade().getPackageName(modelName);
372 }
373
374
375 public java.lang.String getPackageName()
376 {
377 return this.getSuperAttributeFacade().getPackageName();
378 }
379
380
381 public java.lang.String getPackagePath()
382 {
383 return this.getSuperAttributeFacade().getPackagePath();
384 }
385
386
387 public org.andromda.metafacades.uml.PackageFacade getRootPackage()
388 {
389 return this.getSuperAttributeFacade().getRootPackage();
390 }
391
392
393 public java.util.Collection getSourceDependencies()
394 {
395 return this.getSuperAttributeFacade().getSourceDependencies();
396 }
397
398
399 public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
400 {
401 return this.getSuperAttributeFacade().getStateMachineContext();
402 }
403
404
405 public java.util.Collection getStereotypeNames()
406 {
407 return this.getSuperAttributeFacade().getStereotypeNames();
408 }
409
410
411 public java.util.Collection getStereotypes()
412 {
413 return this.getSuperAttributeFacade().getStereotypes();
414 }
415
416
417 public java.util.Collection getTaggedValues()
418 {
419 return this.getSuperAttributeFacade().getTaggedValues();
420 }
421
422
423 public java.util.Collection getTargetDependencies()
424 {
425 return this.getSuperAttributeFacade().getTargetDependencies();
426 }
427
428
429 public java.lang.Object getTemplateParameter(java.lang.String parameterName)
430 {
431 return this.getSuperAttributeFacade().getTemplateParameter(parameterName);
432 }
433
434
435 public java.util.Collection getTemplateParameters()
436 {
437 return this.getSuperAttributeFacade().getTemplateParameters();
438 }
439
440
441 public java.lang.String getVisibility()
442 {
443 return this.getSuperAttributeFacade().getVisibility();
444 }
445
446
447 public boolean hasExactStereotype(java.lang.String stereotypeName)
448 {
449 return this.getSuperAttributeFacade().hasExactStereotype(stereotypeName);
450 }
451
452
453 public boolean hasStereotype(java.lang.String stereotypeName)
454 {
455 return this.getSuperAttributeFacade().hasStereotype(stereotypeName);
456 }
457
458
459 public boolean isBindingDependenciesPresent()
460 {
461 return this.getSuperAttributeFacade().isBindingDependenciesPresent();
462 }
463
464
465 public boolean isConstraintsPresent()
466 {
467 return this.getSuperAttributeFacade().isConstraintsPresent();
468 }
469
470
471 public boolean isTemplateParametersPresent()
472 {
473 return this.getSuperAttributeFacade().isTemplateParametersPresent();
474 }
475
476
477 public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
478 {
479 return this.getSuperAttributeFacade().translateConstraint(name, translation);
480 }
481
482
483 public java.lang.String[] translateConstraints(java.lang.String translation)
484 {
485 return this.getSuperAttributeFacade().translateConstraints(translation);
486 }
487
488
489 public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
490 {
491 return this.getSuperAttributeFacade().translateConstraints(kind, translation);
492 }
493
494 /***
495 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
496 */
497 public void initialize()
498 {
499 this.getSuperAttributeFacade().initialize();
500 }
501
502 /***
503 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
504 */
505 public Object getValidationOwner()
506 {
507 Object owner = this.getSuperAttributeFacade().getValidationOwner();
508 return owner;
509 }
510
511 /***
512 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
513 */
514 public String getValidationName()
515 {
516 String name = this.getSuperAttributeFacade().getValidationName();
517 return name;
518 }
519
520 /***
521 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
522 */
523 public void validateInvariants(java.util.Collection validationMessages)
524 {
525 this.getSuperAttributeFacade().validateInvariants(validationMessages);
526 }
527
528 /***
529 * The property that stores the name of the metafacade.
530 */
531 private static final String NAME_PROPERTY = "name";
532
533 /***
534 * @see java.lang.Object#toString()
535 */
536 public String toString()
537 {
538 final StringBuffer toString = new StringBuffer(this.getClass().getName());
539 toString.append("[");
540 try
541 {
542 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
543 }
544 catch (final Throwable throwable)
545 {
546
547 }
548 toString.append("]");
549 return toString.toString();
550 }
551 }