1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.meta.metafacades;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.common.Introspector;
10 import org.andromda.core.metafacade.MetafacadeBase;
11 import org.andromda.core.metafacade.MetafacadeFactory;
12 import org.andromda.core.metafacade.ModelValidationMessage;
13 import org.andromda.metafacades.uml.AssociationEndFacade;
14 import org.andromda.metafacades.uml.AttributeFacade;
15 import org.andromda.metafacades.uml.ClassifierFacade;
16 import org.andromda.metafacades.uml.ConstraintFacade;
17 import org.andromda.metafacades.uml.DependencyFacade;
18 import org.andromda.metafacades.uml.GeneralizableElementFacade;
19 import org.andromda.metafacades.uml.GeneralizationFacade;
20 import org.andromda.metafacades.uml.ModelElementFacade;
21 import org.andromda.metafacades.uml.ModelFacade;
22 import org.andromda.metafacades.uml.OperationFacade;
23 import org.andromda.metafacades.uml.PackageFacade;
24 import org.andromda.metafacades.uml.StateMachineFacade;
25 import org.andromda.metafacades.uml.StereotypeFacade;
26 import org.andromda.metafacades.uml.TaggedValueFacade;
27 import org.andromda.metafacades.uml.TemplateParameterFacade;
28 import org.andromda.metafacades.uml.TypeMappings;
29 import org.andromda.translation.ocl.validation.OCLCollections;
30 import org.andromda.translation.ocl.validation.OCLIntrospector;
31 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
32 import org.apache.commons.collections.Predicate;
33 import org.apache.log4j.Logger;
34
35 /**
36 * Facade for use in the andromda-meta cartridge. It hides a Classifier that represents a
37 * <<metafacade>> object.
38 * MetafacadeLogic for Metafacade
39 *
40 * @see Metafacade
41 */
42 public abstract class MetafacadeLogic
43 extends MetafacadeBase
44 implements Metafacade
45 {
46 /**
47 * The underlying UML object
48 * @see Object
49 */
50 protected Object metaObject;
51
52 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
53 * @param metaObjectIn
54 * @param context
55 */
56 protected MetafacadeLogic(Object metaObjectIn, String context)
57 {
58 super(metaObjectIn, getContext(context));
59 this.superClassifierFacade =
60 (ClassifierFacade)
61 MetafacadeFactory.getInstance().createFacadeImpl(
62 "org.andromda.metafacades.uml.ClassifierFacade",
63 metaObjectIn,
64 getContext(context));
65 this.metaObject = metaObjectIn;
66 }
67
68 /**
69 * The logger instance.
70 */
71 private static final Logger logger = Logger.getLogger(MetafacadeLogic.class);
72
73 /**
74 * Gets the context for this metafacade logic instance.
75 * @param context String. Set to Metafacade if null
76 * @return context String
77 */
78 private static String getContext(String context)
79 {
80 if (context == null)
81 {
82 context = "org.andromda.cartridges.meta.metafacades.Metafacade";
83 }
84 return context;
85 }
86
87 private ClassifierFacade superClassifierFacade;
88 private boolean superClassifierFacadeInitialized = false;
89
90 /**
91 * Gets the ClassifierFacade parent instance.
92 * @return this.superClassifierFacade ClassifierFacade
93 */
94 private ClassifierFacade getSuperClassifierFacade()
95 {
96 if (!this.superClassifierFacadeInitialized)
97 {
98 ((MetafacadeBase)this.superClassifierFacade).setMetafacadeContext(this.getMetafacadeContext());
99 this.superClassifierFacadeInitialized = true;
100 }
101 return this.superClassifierFacade;
102 }
103
104 /** Reset context only for non-root metafacades
105 * @param context
106 * @see MetafacadeBase#resetMetafacadeContext(String context)
107 */
108 @Override
109 public void resetMetafacadeContext(String context)
110 {
111 if (!this.contextRoot) // reset context only for non-root metafacades
112 {
113 context = getContext(context); // to have same value as in original constructor call
114 setMetafacadeContext (context);
115 if (this.superClassifierFacadeInitialized)
116 {
117 ((MetafacadeBase)this.superClassifierFacade).resetMetafacadeContext(context);
118 }
119 }
120 }
121
122 /**
123 * @return boolean true always
124 * @see Metafacade
125 */
126 public boolean isMetafacadeMetaType()
127 {
128 return true;
129 }
130
131 // --------------- attributes ---------------------
132
133 /**
134 * @see Metafacade#getLogicName()
135 * @return String
136 */
137 protected abstract String handleGetLogicName();
138
139 private String __logicName1a;
140 private boolean __logicName1aSet = false;
141
142 /**
143 * The name of the metafacade 'Logic' class.
144 * @return (String)handleGetLogicName()
145 */
146 public final String getLogicName()
147 {
148 String logicName1a = this.__logicName1a;
149 if (!this.__logicName1aSet)
150 {
151 // logicName has no pre constraints
152 logicName1a = handleGetLogicName();
153 // logicName has no post constraints
154 this.__logicName1a = logicName1a;
155 if (isMetafacadePropertyCachingEnabled())
156 {
157 this.__logicName1aSet = true;
158 }
159 }
160 return logicName1a;
161 }
162
163 /**
164 * @see Metafacade#getLogicImplName()
165 * @return String
166 */
167 protected abstract String handleGetLogicImplName();
168
169 private String __logicImplName2a;
170 private boolean __logicImplName2aSet = false;
171
172 /**
173 * The name of the 'Logic' implementation name.
174 * @return (String)handleGetLogicImplName()
175 */
176 public final String getLogicImplName()
177 {
178 String logicImplName2a = this.__logicImplName2a;
179 if (!this.__logicImplName2aSet)
180 {
181 // logicImplName has no pre constraints
182 logicImplName2a = handleGetLogicImplName();
183 // logicImplName has no post constraints
184 this.__logicImplName2a = logicImplName2a;
185 if (isMetafacadePropertyCachingEnabled())
186 {
187 this.__logicImplName2aSet = true;
188 }
189 }
190 return logicImplName2a;
191 }
192
193 /**
194 * @see Metafacade#isMetaclassDirectDependency()
195 * @return boolean
196 */
197 protected abstract boolean handleIsMetaclassDirectDependency();
198
199 private boolean __metaclassDirectDependency3a;
200 private boolean __metaclassDirectDependency3aSet = false;
201
202 /**
203 * True/false depending on whether or not this class's metaclass is a direct dependency (true)
204 * or an inherited dependency (false).
205 * @return (boolean)handleIsMetaclassDirectDependency()
206 */
207 public final boolean isMetaclassDirectDependency()
208 {
209 boolean metaclassDirectDependency3a = this.__metaclassDirectDependency3a;
210 if (!this.__metaclassDirectDependency3aSet)
211 {
212 // metaclassDirectDependency has no pre constraints
213 metaclassDirectDependency3a = handleIsMetaclassDirectDependency();
214 // metaclassDirectDependency has no post constraints
215 this.__metaclassDirectDependency3a = metaclassDirectDependency3a;
216 if (isMetafacadePropertyCachingEnabled())
217 {
218 this.__metaclassDirectDependency3aSet = true;
219 }
220 }
221 return metaclassDirectDependency3a;
222 }
223
224 /**
225 * @see Metafacade#getFullyQualifiedLogicImplName()
226 * @return String
227 */
228 protected abstract String handleGetFullyQualifiedLogicImplName();
229
230 private String __fullyQualifiedLogicImplName4a;
231 private boolean __fullyQualifiedLogicImplName4aSet = false;
232
233 /**
234 * The fully qualified name for the implementation of the metafacade.
235 * @return (String)handleGetFullyQualifiedLogicImplName()
236 */
237 public final String getFullyQualifiedLogicImplName()
238 {
239 String fullyQualifiedLogicImplName4a = this.__fullyQualifiedLogicImplName4a;
240 if (!this.__fullyQualifiedLogicImplName4aSet)
241 {
242 // fullyQualifiedLogicImplName has no pre constraints
243 fullyQualifiedLogicImplName4a = handleGetFullyQualifiedLogicImplName();
244 // fullyQualifiedLogicImplName has no post constraints
245 this.__fullyQualifiedLogicImplName4a = fullyQualifiedLogicImplName4a;
246 if (isMetafacadePropertyCachingEnabled())
247 {
248 this.__fullyQualifiedLogicImplName4aSet = true;
249 }
250 }
251 return fullyQualifiedLogicImplName4a;
252 }
253
254 /**
255 * @see Metafacade#getFullyQualifiedLogicName()
256 * @return String
257 */
258 protected abstract String handleGetFullyQualifiedLogicName();
259
260 private String __fullyQualifiedLogicName5a;
261 private boolean __fullyQualifiedLogicName5aSet = false;
262
263 /**
264 * The fully qualified name for the metafacade "Logic" class.
265 * @return (String)handleGetFullyQualifiedLogicName()
266 */
267 public final String getFullyQualifiedLogicName()
268 {
269 String fullyQualifiedLogicName5a = this.__fullyQualifiedLogicName5a;
270 if (!this.__fullyQualifiedLogicName5aSet)
271 {
272 // fullyQualifiedLogicName has no pre constraints
273 fullyQualifiedLogicName5a = handleGetFullyQualifiedLogicName();
274 // fullyQualifiedLogicName has no post constraints
275 this.__fullyQualifiedLogicName5a = fullyQualifiedLogicName5a;
276 if (isMetafacadePropertyCachingEnabled())
277 {
278 this.__fullyQualifiedLogicName5aSet = true;
279 }
280 }
281 return fullyQualifiedLogicName5a;
282 }
283
284 /**
285 * @see Metafacade#getLogicFile()
286 * @return String
287 */
288 protected abstract String handleGetLogicFile();
289
290 private String __logicFile6a;
291 private boolean __logicFile6aSet = false;
292
293 /**
294 * The 'Logic' file location.
295 * @return (String)handleGetLogicFile()
296 */
297 public final String getLogicFile()
298 {
299 String logicFile6a = this.__logicFile6a;
300 if (!this.__logicFile6aSet)
301 {
302 // logicFile has no pre constraints
303 logicFile6a = handleGetLogicFile();
304 // logicFile has no post constraints
305 this.__logicFile6a = logicFile6a;
306 if (isMetafacadePropertyCachingEnabled())
307 {
308 this.__logicFile6aSet = true;
309 }
310 }
311 return logicFile6a;
312 }
313
314 /**
315 * @see Metafacade#getLogicImplFile()
316 * @return String
317 */
318 protected abstract String handleGetLogicImplFile();
319
320 private String __logicImplFile7a;
321 private boolean __logicImplFile7aSet = false;
322
323 /**
324 * The 'Logic' implementation file location.
325 * @return (String)handleGetLogicImplFile()
326 */
327 public final String getLogicImplFile()
328 {
329 String logicImplFile7a = this.__logicImplFile7a;
330 if (!this.__logicImplFile7aSet)
331 {
332 // logicImplFile has no pre constraints
333 logicImplFile7a = handleGetLogicImplFile();
334 // logicImplFile has no post constraints
335 this.__logicImplFile7a = logicImplFile7a;
336 if (isMetafacadePropertyCachingEnabled())
337 {
338 this.__logicImplFile7aSet = true;
339 }
340 }
341 return logicImplFile7a;
342 }
343
344 /**
345 * @see Metafacade#getLogicPackageName()
346 * @return String
347 */
348 protected abstract String handleGetLogicPackageName();
349
350 private String __logicPackageName8a;
351 private boolean __logicPackageName8aSet = false;
352
353 /**
354 * The package name to which the 'Logic' metafacade classes are generated.
355 * @return (String)handleGetLogicPackageName()
356 */
357 public final String getLogicPackageName()
358 {
359 String logicPackageName8a = this.__logicPackageName8a;
360 if (!this.__logicPackageName8aSet)
361 {
362 // logicPackageName has no pre constraints
363 logicPackageName8a = handleGetLogicPackageName();
364 // logicPackageName has no post constraints
365 this.__logicPackageName8a = logicPackageName8a;
366 if (isMetafacadePropertyCachingEnabled())
367 {
368 this.__logicPackageName8aSet = true;
369 }
370 }
371 return logicPackageName8a;
372 }
373
374 /**
375 * @see Metafacade#isRequiresInheritanceDelegatation()
376 * @return boolean
377 */
378 protected abstract boolean handleIsRequiresInheritanceDelegatation();
379
380 private boolean __requiresInheritanceDelegatation9a;
381 private boolean __requiresInheritanceDelegatation9aSet = false;
382
383 /**
384 * Indicates if the metafacade requires a delegate for inheritance instead of actual
385 * inheritance. This is true, when the metafacade is inheriting from a metafacade from a
386 * different package (since that means it will most likely be a cartridge metafacade inheriting
387 * from a set of shared metafacades for a meta model).
388 * @return (boolean)handleIsRequiresInheritanceDelegatation()
389 */
390 public final boolean isRequiresInheritanceDelegatation()
391 {
392 boolean requiresInheritanceDelegatation9a = this.__requiresInheritanceDelegatation9a;
393 if (!this.__requiresInheritanceDelegatation9aSet)
394 {
395 // requiresInheritanceDelegatation has no pre constraints
396 requiresInheritanceDelegatation9a = handleIsRequiresInheritanceDelegatation();
397 // requiresInheritanceDelegatation has no post constraints
398 this.__requiresInheritanceDelegatation9a = requiresInheritanceDelegatation9a;
399 if (isMetafacadePropertyCachingEnabled())
400 {
401 this.__requiresInheritanceDelegatation9aSet = true;
402 }
403 }
404 return requiresInheritanceDelegatation9a;
405 }
406
407 /**
408 * @see Metafacade#isConstructorRequiresMetaclassCast()
409 * @return boolean
410 */
411 protected abstract boolean handleIsConstructorRequiresMetaclassCast();
412
413 private boolean __constructorRequiresMetaclassCast10a;
414 private boolean __constructorRequiresMetaclassCast10aSet = false;
415
416 /**
417 * Indicates if the meta class construct argument requires a cast to the super metafacade's
418 * metaclass.
419 * @return (boolean)handleIsConstructorRequiresMetaclassCast()
420 */
421 public final boolean isConstructorRequiresMetaclassCast()
422 {
423 boolean constructorRequiresMetaclassCast10a = this.__constructorRequiresMetaclassCast10a;
424 if (!this.__constructorRequiresMetaclassCast10aSet)
425 {
426 // constructorRequiresMetaclassCast has no pre constraints
427 constructorRequiresMetaclassCast10a = handleIsConstructorRequiresMetaclassCast();
428 // constructorRequiresMetaclassCast has no post constraints
429 this.__constructorRequiresMetaclassCast10a = constructorRequiresMetaclassCast10a;
430 if (isMetafacadePropertyCachingEnabled())
431 {
432 this.__constructorRequiresMetaclassCast10aSet = true;
433 }
434 }
435 return constructorRequiresMetaclassCast10a;
436 }
437
438 /**
439 * @see Metafacade#getGeneralizationCount()
440 * @return int
441 */
442 protected abstract int handleGetGeneralizationCount();
443
444 private int __generalizationCount11a;
445 private boolean __generalizationCount11aSet = false;
446
447 /**
448 * The number of parents this metafacade has.
449 * @return (int)handleGetGeneralizationCount()
450 */
451 public final int getGeneralizationCount()
452 {
453 int generalizationCount11a = this.__generalizationCount11a;
454 if (!this.__generalizationCount11aSet)
455 {
456 // generalizationCount has no pre constraints
457 generalizationCount11a = handleGetGeneralizationCount();
458 // generalizationCount has no post constraints
459 this.__generalizationCount11a = generalizationCount11a;
460 if (isMetafacadePropertyCachingEnabled())
461 {
462 this.__generalizationCount11aSet = true;
463 }
464 }
465 return generalizationCount11a;
466 }
467
468 // ---------------- business methods ----------------------
469
470 /**
471 * Method to be implemented in descendants
472 * Gets all inherited method information as a collection of MethodData instances for the given
473 * superMetafacade.
474 * @param superMetafacade
475 * @return Collection
476 */
477 protected abstract Collection handleGetMethodDataForPSM(ClassifierFacade superMetafacade);
478
479 /**
480 * Gets all inherited method information as a collection of MethodData instances for the given
481 * superMetafacade.
482 * @param superMetafacade ClassifierFacade
483 * The super metafacade for which to retrieve the collection of method data.
484 * @return handleGetMethodDataForPSM(superMetafacade)
485 */
486 public Collection getMethodDataForPSM(ClassifierFacade superMetafacade)
487 {
488 // getMethodDataForPSM has no pre constraints
489 Collection returnValue = handleGetMethodDataForPSM(superMetafacade);
490 // getMethodDataForPSM has no post constraints
491 return returnValue;
492 }
493
494 /**
495 * Method to be implemented in descendants
496 * Gets all method information as a collection of MethodData instances for the metafacade.
497 * @return Collection
498 */
499 protected abstract Collection handleGetMethodDataForPSM();
500
501 /**
502 * Gets all method information as a collection of MethodData instances for the metafacade.
503 * @return handleGetMethodDataForPSM()
504 */
505 public Collection getMethodDataForPSM()
506 {
507 // getMethodDataForPSM has no pre constraints
508 Collection returnValue = handleGetMethodDataForPSM();
509 // getMethodDataForPSM has no post constraints
510 return returnValue;
511 }
512
513 // ------------- associations ------------------
514
515 private ClassifierFacade __getMetaclass1r;
516 private boolean __getMetaclass1rSet = false;
517
518 /**
519 * Facade for use in the andromda-meta cartridge. It hides a Classifier that represents a
520 * <<metafacade>> object.
521 * @return (ClassifierFacade)handleGetMetaclass()
522 */
523 public final ClassifierFacade getMetaclass()
524 {
525 ClassifierFacade getMetaclass1r = this.__getMetaclass1r;
526 if (!this.__getMetaclass1rSet)
527 {
528 // metafacade has no pre constraints
529 Object result = handleGetMetaclass();
530 MetafacadeBase shieldedResult = this.shieldedElement(result);
531 try
532 {
533 getMetaclass1r = (ClassifierFacade)shieldedResult;
534 }
535 catch (ClassCastException ex)
536 {
537 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
538 MetafacadeLogic.logger.warn("incorrect metafacade cast for MetafacadeLogic.getMetaclass ClassifierFacade " + result + ": " + shieldedResult);
539 }
540 // metafacade has no post constraints
541 this.__getMetaclass1r = getMetaclass1r;
542 if (isMetafacadePropertyCachingEnabled())
543 {
544 this.__getMetaclass1rSet = true;
545 }
546 }
547 return getMetaclass1r;
548 }
549
550 /**
551 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
552 * @return Object
553 */
554 protected abstract Object handleGetMetaclass();
555
556 /**
557 * Facade for use in the andromda-meta cartridge. It hides a Classifier that represents a
558 * <<metafacade>> object.
559 * @return (Collection<Metafacade>)handleGetAllParents()
560 */
561 public final Collection<Metafacade> getAllParents()
562 {
563 Collection<Metafacade> getAllParents2r = null;
564 // metafacade has no pre constraints
565 Collection result = handleGetAllParents();
566 List shieldedResult = this.shieldedElements(result);
567 try
568 {
569 getAllParents2r = (Collection<Metafacade>)shieldedResult;
570 }
571 catch (ClassCastException ex)
572 {
573 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
574 MetafacadeLogic.logger.warn("incorrect metafacade cast for MetafacadeLogic.getAllParents Collection<Metafacade> " + result + ": " + shieldedResult);
575 }
576 // metafacade has no post constraints
577 return getAllParents2r;
578 }
579
580 /**
581 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
582 * @return Collection
583 */
584 protected abstract Collection handleGetAllParents();
585
586 /**
587 * @return true
588 * @see ClassifierFacade
589 */
590 public boolean isClassifierFacadeMetaType()
591 {
592 return true;
593 }
594
595 /**
596 * @return true
597 * @see GeneralizableElementFacade
598 */
599 public boolean isGeneralizableElementFacadeMetaType()
600 {
601 return true;
602 }
603
604 /**
605 * @return true
606 * @see ModelElementFacade
607 */
608 public boolean isModelElementFacadeMetaType()
609 {
610 return true;
611 }
612
613 // ----------- delegates to ClassifierFacade ------------
614 /**
615 * Return the attribute which name matches the parameter
616 * @see ClassifierFacade#findAttribute(String name)
617 */
618 public AttributeFacade findAttribute(String name)
619 {
620 return this.getSuperClassifierFacade().findAttribute(name);
621 }
622
623 /**
624 * Those abstraction dependencies for which this classifier is the client.
625 * @see ClassifierFacade#getAbstractions()
626 */
627 public Collection<ClassifierFacade> getAbstractions()
628 {
629 return this.getSuperClassifierFacade().getAbstractions();
630 }
631
632 /**
633 * Lists all classes associated to this one and any ancestor classes (through generalization).
634 * There will be no duplicates. The order of the elements is predictable.
635 * @see ClassifierFacade#getAllAssociatedClasses()
636 */
637 public Collection<ClassifierFacade> getAllAssociatedClasses()
638 {
639 return this.getSuperClassifierFacade().getAllAssociatedClasses();
640 }
641
642 /**
643 * A collection containing all 'properties' of the classifier and its ancestors. Properties are
644 * any attributes and navigable connecting association ends.
645 * @see ClassifierFacade#getAllProperties()
646 */
647 public Collection<ModelElementFacade> getAllProperties()
648 {
649 return this.getSuperClassifierFacade().getAllProperties();
650 }
651
652 /**
653 * A collection containing all required and/or read-only 'properties' of the classifier and its
654 * ancestors. Properties are any attributes and navigable connecting association ends.
655 * @see ClassifierFacade#getAllRequiredConstructorParameters()
656 */
657 public Collection<ModelElementFacade> getAllRequiredConstructorParameters()
658 {
659 return this.getSuperClassifierFacade().getAllRequiredConstructorParameters();
660 }
661
662 /**
663 * Gets the array type for this classifier. If this classifier already represents an array, it
664 * just returns itself.
665 * @see ClassifierFacade#getArray()
666 */
667 public ClassifierFacade getArray()
668 {
669 return this.getSuperClassifierFacade().getArray();
670 }
671
672 /**
673 * The name of the classifier as an array.
674 * @see ClassifierFacade#getArrayName()
675 */
676 public String getArrayName()
677 {
678 return this.getSuperClassifierFacade().getArrayName();
679 }
680
681 /**
682 * Lists the classes associated to this one, there is no repitition of classes. The order of the
683 * elements is predictable.
684 * @see ClassifierFacade#getAssociatedClasses()
685 */
686 public Collection<ClassifierFacade> getAssociatedClasses()
687 {
688 return this.getSuperClassifierFacade().getAssociatedClasses();
689 }
690
691 /**
692 * Gets the association ends belonging to a classifier.
693 * @see ClassifierFacade#getAssociationEnds()
694 */
695 public List<AssociationEndFacade> getAssociationEnds()
696 {
697 return this.getSuperClassifierFacade().getAssociationEnds();
698 }
699
700 /**
701 * Gets the attributes that belong to the classifier.
702 * @see ClassifierFacade#getAttributes()
703 */
704 public List<AttributeFacade> getAttributes()
705 {
706 return this.getSuperClassifierFacade().getAttributes();
707 }
708
709 /**
710 * Gets all attributes for the classifier and if 'follow' is true goes up the inheritance
711 * hierarchy and gets the attributes from the super classes as well.
712 * @see ClassifierFacade#getAttributes(boolean follow)
713 */
714 public List<AttributeFacade> getAttributes(boolean follow)
715 {
716 return this.getSuperClassifierFacade().getAttributes(follow);
717 }
718
719 /**
720 * The fully qualified name of the classifier as an array.
721 * @see ClassifierFacade#getFullyQualifiedArrayName()
722 */
723 public String getFullyQualifiedArrayName()
724 {
725 return this.getSuperClassifierFacade().getFullyQualifiedArrayName();
726 }
727
728 /**
729 * Returns all those operations that could be implemented at this classifier's level. This means
730 * the operations owned by this classifier as well as any realized interface's operations
731 * (recursively) in case this classifier itself is not already an interface, or generalized when
732 * this classifier is an interface.
733 * @see ClassifierFacade#getImplementationOperations()
734 */
735 public Collection<OperationFacade> getImplementationOperations()
736 {
737 return this.getSuperClassifierFacade().getImplementationOperations();
738 }
739
740 /**
741 * A comma separated list of the fully qualified names of all implemented interfaces.
742 * @see ClassifierFacade#getImplementedInterfaceList()
743 */
744 public String getImplementedInterfaceList()
745 {
746 return this.getSuperClassifierFacade().getImplementedInterfaceList();
747 }
748
749 /**
750 * Those attributes that are scoped to an instance of this class.
751 * @see ClassifierFacade#getInstanceAttributes()
752 */
753 public Collection<AttributeFacade> getInstanceAttributes()
754 {
755 return this.getSuperClassifierFacade().getInstanceAttributes();
756 }
757
758 /**
759 * Those operations that are scoped to an instance of this class.
760 * @see ClassifierFacade#getInstanceOperations()
761 */
762 public List<OperationFacade> getInstanceOperations()
763 {
764 return this.getSuperClassifierFacade().getInstanceOperations();
765 }
766
767 /**
768 * Those interfaces that are abstractions of this classifier, this basically means this
769 * classifier realizes them.
770 * @see ClassifierFacade#getInterfaceAbstractions()
771 */
772 public Collection<ClassifierFacade> getInterfaceAbstractions()
773 {
774 return this.getSuperClassifierFacade().getInterfaceAbstractions();
775 }
776
777 /**
778 * A String representing a new Constructor declaration for this classifier type to be used in a
779 * Java environment.
780 * @see ClassifierFacade#getJavaNewString()
781 */
782 public String getJavaNewString()
783 {
784 return this.getSuperClassifierFacade().getJavaNewString();
785 }
786
787 /**
788 * A String representing the null-value for this classifier type to be used in a Java
789 * environment.
790 * @see ClassifierFacade#getJavaNullString()
791 */
792 public String getJavaNullString()
793 {
794 return this.getSuperClassifierFacade().getJavaNullString();
795 }
796
797 /**
798 * The other ends of this classifier's association ends which are navigable.
799 * @see ClassifierFacade#getNavigableConnectingEnds()
800 */
801 public Collection<AssociationEndFacade> getNavigableConnectingEnds()
802 {
803 return this.getSuperClassifierFacade().getNavigableConnectingEnds();
804 }
805
806 /**
807 * Get the other ends of this classifier's association ends which are navigable and if 'follow'
808 * is true goes up the inheritance hierarchy and gets the super association ends as well.
809 * @see ClassifierFacade#getNavigableConnectingEnds(boolean follow)
810 */
811 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow)
812 {
813 return this.getSuperClassifierFacade().getNavigableConnectingEnds(follow);
814 }
815
816 /**
817 * Assuming that the classifier is an array, this will return the non array type of the
818 * classifier from
819 * the model. If the classifier is NOT an array, it will just return itself.
820 * @see ClassifierFacade#getNonArray()
821 */
822 public ClassifierFacade getNonArray()
823 {
824 return this.getSuperClassifierFacade().getNonArray();
825 }
826
827 /**
828 * The attributes from this classifier in the form of an operation call (this example would be
829 * in Java): '(String attributeOne, String attributeTwo). If there were no attributes on the
830 * classifier, the result would be an empty '()'.
831 * @see ClassifierFacade#getOperationCallFromAttributes()
832 */
833 public String getOperationCallFromAttributes()
834 {
835 return this.getSuperClassifierFacade().getOperationCallFromAttributes();
836 }
837
838 /**
839 * The operations owned by this classifier.
840 * @see ClassifierFacade#getOperations()
841 */
842 public List<OperationFacade> getOperations()
843 {
844 return this.getSuperClassifierFacade().getOperations();
845 }
846
847 /**
848 * A collection containing all 'properties' of the classifier. Properties are any attributes
849 * and navigable connecting association ends.
850 * @see ClassifierFacade#getProperties()
851 */
852 public List<ModelElementFacade> getProperties()
853 {
854 return this.getSuperClassifierFacade().getProperties();
855 }
856
857 /**
858 * Gets all properties (attributes and navigable association ends) for the classifier and if
859 * 'follow' is true goes up the inheritance hierarchy and gets the properties from the super
860 * classes as well.
861 * @see ClassifierFacade#getProperties(boolean follow)
862 */
863 public List getProperties(boolean follow)
864 {
865 return this.getSuperClassifierFacade().getProperties(follow);
866 }
867
868 /**
869 * A collection containing all required and/or read-only 'properties' of the classifier.
870 * Properties are any attributes and navigable connecting association ends.
871 * @see ClassifierFacade#getRequiredConstructorParameters()
872 */
873 public Collection<ModelElementFacade> getRequiredConstructorParameters()
874 {
875 return this.getSuperClassifierFacade().getRequiredConstructorParameters();
876 }
877
878 /**
879 * Returns the serial version UID of the underlying model element.
880 * @see ClassifierFacade#getSerialVersionUID()
881 */
882 public long getSerialVersionUID()
883 {
884 return this.getSuperClassifierFacade().getSerialVersionUID();
885 }
886
887 /**
888 * Those attributes that are scoped to the definition of this class.
889 * @see ClassifierFacade#getStaticAttributes()
890 */
891 public Collection<AttributeFacade> getStaticAttributes()
892 {
893 return this.getSuperClassifierFacade().getStaticAttributes();
894 }
895
896 /**
897 * Those operations that are scoped to the definition of this class.
898 * @see ClassifierFacade#getStaticOperations()
899 */
900 public List<OperationFacade> getStaticOperations()
901 {
902 return this.getSuperClassifierFacade().getStaticOperations();
903 }
904
905 /**
906 * This class' superclass, returns the generalization if it is a ClassifierFacade, null
907 * otherwise.
908 * @see ClassifierFacade#getSuperClass()
909 */
910 public ClassifierFacade getSuperClass()
911 {
912 return this.getSuperClassifierFacade().getSuperClass();
913 }
914
915 /**
916 * The wrapper name for this classifier if a mapped type has a defined wrapper class (ie. 'long'
917 * maps to 'Long'). If the classifier doesn't have a wrapper defined for it, this method will
918 * return a null. Note that wrapper mappings must be defined for the namespace by defining the
919 * 'wrapperMappingsUri', this property must point to the location of the mappings file which
920 * maps the primitives to wrapper types.
921 * @see ClassifierFacade#getWrapperName()
922 */
923 public String getWrapperName()
924 {
925 return this.getSuperClassifierFacade().getWrapperName();
926 }
927
928 /**
929 * Indicates if this classifier is 'abstract'.
930 * @see ClassifierFacade#isAbstract()
931 */
932 public boolean isAbstract()
933 {
934 return this.getSuperClassifierFacade().isAbstract();
935 }
936
937 /**
938 * True if this classifier represents an array type. False otherwise.
939 * @see ClassifierFacade#isArrayType()
940 */
941 public boolean isArrayType()
942 {
943 return this.getSuperClassifierFacade().isArrayType();
944 }
945
946 /**
947 * True if the ClassifierFacade is an AssociationClass.
948 * @see ClassifierFacade#isAssociationClass()
949 */
950 public boolean isAssociationClass()
951 {
952 return this.getSuperClassifierFacade().isAssociationClass();
953 }
954
955 /**
956 * Returns true if this type represents a Blob type.
957 * @see ClassifierFacade#isBlobType()
958 */
959 public boolean isBlobType()
960 {
961 return this.getSuperClassifierFacade().isBlobType();
962 }
963
964 /**
965 * Indicates if this type represents a boolean type or not.
966 * @see ClassifierFacade#isBooleanType()
967 */
968 public boolean isBooleanType()
969 {
970 return this.getSuperClassifierFacade().isBooleanType();
971 }
972
973 /**
974 * Indicates if this type represents a char, Character, or java.lang.Character type or not.
975 * @see ClassifierFacade#isCharacterType()
976 */
977 public boolean isCharacterType()
978 {
979 return this.getSuperClassifierFacade().isCharacterType();
980 }
981
982 /**
983 * Returns true if this type represents a Clob type.
984 * @see ClassifierFacade#isClobType()
985 */
986 public boolean isClobType()
987 {
988 return this.getSuperClassifierFacade().isClobType();
989 }
990
991 /**
992 * True if this classifier represents a collection type. False otherwise.
993 * @see ClassifierFacade#isCollectionType()
994 */
995 public boolean isCollectionType()
996 {
997 return this.getSuperClassifierFacade().isCollectionType();
998 }
999
1000 /**
1001 * True/false depending on whether or not this classifier represents a datatype. A data type is
1002 * a type whose instances are identified only by their value. A data type may contain attributes
1003 * to support the modeling of structured data types.
1004 * @see ClassifierFacade#isDataType()
1005 */
1006 public boolean isDataType()
1007 {
1008 return this.getSuperClassifierFacade().isDataType();
1009 }
1010
1011 /**
1012 * True when this classifier is a date type.
1013 * @see ClassifierFacade#isDateType()
1014 */
1015 public boolean isDateType()
1016 {
1017 return this.getSuperClassifierFacade().isDateType();
1018 }
1019
1020 /**
1021 * Indicates if this type represents a Double type or not.
1022 * @see ClassifierFacade#isDoubleType()
1023 */
1024 public boolean isDoubleType()
1025 {
1026 return this.getSuperClassifierFacade().isDoubleType();
1027 }
1028
1029 /**
1030 * Indicates whether or not this classifier represents an "EmbeddedValue'.
1031 * @see ClassifierFacade#isEmbeddedValue()
1032 */
1033 public boolean isEmbeddedValue()
1034 {
1035 return this.getSuperClassifierFacade().isEmbeddedValue();
1036 }
1037
1038 /**
1039 * True if this classifier is in fact marked as an enumeration.
1040 * @see ClassifierFacade#isEnumeration()
1041 */
1042 public boolean isEnumeration()
1043 {
1044 return this.getSuperClassifierFacade().isEnumeration();
1045 }
1046
1047 /**
1048 * Returns true if this type represents a 'file' type.
1049 * @see ClassifierFacade#isFileType()
1050 */
1051 public boolean isFileType()
1052 {
1053 return this.getSuperClassifierFacade().isFileType();
1054 }
1055
1056 /**
1057 * Indicates if this type represents a Float type or not.
1058 * @see ClassifierFacade#isFloatType()
1059 */
1060 public boolean isFloatType()
1061 {
1062 return this.getSuperClassifierFacade().isFloatType();
1063 }
1064
1065 /**
1066 * Indicates if this type represents an int or Integer or java.lang.Integer type or not.
1067 * @see ClassifierFacade#isIntegerType()
1068 */
1069 public boolean isIntegerType()
1070 {
1071 return this.getSuperClassifierFacade().isIntegerType();
1072 }
1073
1074 /**
1075 * True/false depending on whether or not this Classifier represents an interface.
1076 * @see ClassifierFacade#isInterface()
1077 */
1078 public boolean isInterface()
1079 {
1080 return this.getSuperClassifierFacade().isInterface();
1081 }
1082
1083 /**
1084 * True if this classifier cannot be extended and represent a leaf in the inheritance tree.
1085 * @see ClassifierFacade#isLeaf()
1086 */
1087 public boolean isLeaf()
1088 {
1089 return this.getSuperClassifierFacade().isLeaf();
1090 }
1091
1092 /**
1093 * True if this classifier represents a list type. False otherwise.
1094 * @see ClassifierFacade#isListType()
1095 */
1096 public boolean isListType()
1097 {
1098 return this.getSuperClassifierFacade().isListType();
1099 }
1100
1101 /**
1102 * Indicates if this type represents a Long type or not.
1103 * @see ClassifierFacade#isLongType()
1104 */
1105 public boolean isLongType()
1106 {
1107 return this.getSuperClassifierFacade().isLongType();
1108 }
1109
1110 /**
1111 * Indicates whether or not this classifier represents a Map type.
1112 * @see ClassifierFacade#isMapType()
1113 */
1114 public boolean isMapType()
1115 {
1116 return this.getSuperClassifierFacade().isMapType();
1117 }
1118
1119 /**
1120 * Indicates whether or not this classifier represents a primitive type.
1121 * @see ClassifierFacade#isPrimitive()
1122 */
1123 public boolean isPrimitive()
1124 {
1125 return this.getSuperClassifierFacade().isPrimitive();
1126 }
1127
1128 /**
1129 * True if this classifier represents a set type. False otherwise.
1130 * @see ClassifierFacade#isSetType()
1131 */
1132 public boolean isSetType()
1133 {
1134 return this.getSuperClassifierFacade().isSetType();
1135 }
1136
1137 /**
1138 * Indicates whether or not this classifier represents a string type.
1139 * @see ClassifierFacade#isStringType()
1140 */
1141 public boolean isStringType()
1142 {
1143 return this.getSuperClassifierFacade().isStringType();
1144 }
1145
1146 /**
1147 * Indicates whether or not this classifier represents a time type.
1148 * @see ClassifierFacade#isTimeType()
1149 */
1150 public boolean isTimeType()
1151 {
1152 return this.getSuperClassifierFacade().isTimeType();
1153 }
1154
1155 /**
1156 * Returns true if this type is a wrapped primitive type.
1157 * @see ClassifierFacade#isWrappedPrimitive()
1158 */
1159 public boolean isWrappedPrimitive()
1160 {
1161 return this.getSuperClassifierFacade().isWrappedPrimitive();
1162 }
1163
1164 /**
1165 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set
1166 * to true.
1167 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow)
1168 */
1169 public Object findTaggedValue(String tagName, boolean follow)
1170 {
1171 return this.getSuperClassifierFacade().findTaggedValue(tagName, follow);
1172 }
1173
1174 /**
1175 * All generalizations for this generalizable element, goes up the inheritance tree.
1176 * @see GeneralizableElementFacade#getAllGeneralizations()
1177 */
1178 public Collection<GeneralizableElementFacade> getAllGeneralizations()
1179 {
1180 return this.getSuperClassifierFacade().getAllGeneralizations();
1181 }
1182
1183 /**
1184 * All specializations (travels down the inheritance hierarchy).
1185 * @see GeneralizableElementFacade#getAllSpecializations()
1186 */
1187 public Collection<GeneralizableElementFacade> getAllSpecializations()
1188 {
1189 return this.getSuperClassifierFacade().getAllSpecializations();
1190 }
1191
1192 /**
1193 * Gets the direct generalization for this generalizable element.
1194 * @see GeneralizableElementFacade#getGeneralization()
1195 */
1196 public GeneralizableElementFacade getGeneralization()
1197 {
1198 return this.getSuperClassifierFacade().getGeneralization();
1199 }
1200
1201 /**
1202 * Gets the actual links that this generalization element is part of (it plays either the
1203 * specialization or generalization).
1204 * @see GeneralizableElementFacade#getGeneralizationLinks()
1205 */
1206 public Collection<GeneralizationFacade> getGeneralizationLinks()
1207 {
1208 return this.getSuperClassifierFacade().getGeneralizationLinks();
1209 }
1210
1211 /**
1212 * A comma separated list of the fully qualified names of all generalizations.
1213 * @see GeneralizableElementFacade#getGeneralizationList()
1214 */
1215 public String getGeneralizationList()
1216 {
1217 return this.getSuperClassifierFacade().getGeneralizationList();
1218 }
1219
1220 /**
1221 * The element found when you recursively follow the generalization path up to the root. If an
1222 * element has no generalization itself will be considered the root.
1223 * @see GeneralizableElementFacade#getGeneralizationRoot()
1224 */
1225 public GeneralizableElementFacade getGeneralizationRoot()
1226 {
1227 return this.getSuperClassifierFacade().getGeneralizationRoot();
1228 }
1229
1230 /**
1231 * Return all generalizations (ancestors) from this generalizable element.
1232 * @see GeneralizableElementFacade#getGeneralizations()
1233 */
1234 public Collection<GeneralizableElementFacade> getGeneralizations()
1235 {
1236 return this.getSuperClassifierFacade().getGeneralizations();
1237 }
1238
1239 /**
1240 * Gets the direct specializations (i.e. sub elements) for this generalizatble element.
1241 * @see GeneralizableElementFacade#getSpecializations()
1242 */
1243 public Collection<GeneralizableElementFacade> getSpecializations()
1244 {
1245 return this.getSuperClassifierFacade().getSpecializations();
1246 }
1247
1248 /**
1249 * Copies all tagged values from the given ModelElementFacade to this model element facade.
1250 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
1251 */
1252 public void copyTaggedValues(ModelElementFacade element)
1253 {
1254 this.getSuperClassifierFacade().copyTaggedValues(element);
1255 }
1256
1257 /**
1258 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
1259 * one found will be returned.
1260 * @see ModelElementFacade#findTaggedValue(String tagName)
1261 */
1262 public Object findTaggedValue(String tagName)
1263 {
1264 return this.getSuperClassifierFacade().findTaggedValue(tagName);
1265 }
1266
1267 /**
1268 * Returns all the values for the tagged value with the specified name. The returned collection
1269 * will contains only String instances, or will be empty. Never null.
1270 * @see ModelElementFacade#findTaggedValues(String tagName)
1271 */
1272 public Collection<Object> findTaggedValues(String tagName)
1273 {
1274 return this.getSuperClassifierFacade().findTaggedValues(tagName);
1275 }
1276
1277 /**
1278 * Returns the fully qualified name of the model element. The fully qualified name includes
1279 * complete package qualified name of the underlying model element. The templates parameter will
1280 * be replaced by the correct one given the binding relation of the parameter to this element.
1281 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1282 */
1283 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
1284 {
1285 return this.getSuperClassifierFacade().getBindedFullyQualifiedName(bindedElement);
1286 }
1287
1288 /**
1289 * Gets all constraints belonging to the model element.
1290 * @see ModelElementFacade#getConstraints()
1291 */
1292 public Collection<ConstraintFacade> getConstraints()
1293 {
1294 return this.getSuperClassifierFacade().getConstraints();
1295 }
1296
1297 /**
1298 * Returns the constraints of the argument kind that have been placed onto this model. Typical
1299 * kinds are "inv", "pre" and "post". Other kinds are possible.
1300 * @see ModelElementFacade#getConstraints(String kind)
1301 */
1302 public Collection<ConstraintFacade> getConstraints(String kind)
1303 {
1304 return this.getSuperClassifierFacade().getConstraints(kind);
1305 }
1306
1307 /**
1308 * Gets the documentation for the model element, The indent argument is prefixed to each line.
1309 * By default this method wraps lines after 64 characters.
1310 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
1311 * @see ModelElementFacade#getDocumentation(String indent)
1312 */
1313 public String getDocumentation(String indent)
1314 {
1315 return this.getSuperClassifierFacade().getDocumentation(indent);
1316 }
1317
1318 /**
1319 * This method returns the documentation for this model element, with the lines wrapped after
1320 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1321 * required. By default paragraphs are returned as HTML.
1322 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
1323 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
1324 */
1325 public String getDocumentation(String indent, int lineLength)
1326 {
1327 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength);
1328 }
1329
1330 /**
1331 * This method returns the documentation for this model element, with the lines wrapped after
1332 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1333 * required. HTML style determines if HTML Escaping is applied.
1334 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
1335 */
1336 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1337 {
1338 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength, htmlStyle);
1339 }
1340
1341 /**
1342 * The fully qualified name of this model element.
1343 * @see ModelElementFacade#getFullyQualifiedName()
1344 */
1345 public String getFullyQualifiedName()
1346 {
1347 return this.getSuperClassifierFacade().getFullyQualifiedName();
1348 }
1349
1350 /**
1351 * Returns the fully qualified name of the model element. The fully qualified name includes
1352 * complete package qualified name of the underlying model element. If modelName is true, then
1353 * the original name of the model element (the name contained within the model) will be the name
1354 * returned, otherwise a name from a language mapping will be returned.
1355 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
1356 */
1357 public String getFullyQualifiedName(boolean modelName)
1358 {
1359 return this.getSuperClassifierFacade().getFullyQualifiedName(modelName);
1360 }
1361
1362 /**
1363 * Returns the fully qualified name as a path, the returned value always starts with out a slash
1364 * '/'.
1365 * @see ModelElementFacade#getFullyQualifiedNamePath()
1366 */
1367 public String getFullyQualifiedNamePath()
1368 {
1369 return this.getSuperClassifierFacade().getFullyQualifiedNamePath();
1370 }
1371
1372 /**
1373 * Gets the unique identifier of the underlying model element.
1374 * @see ModelElementFacade#getId()
1375 */
1376 public String getId()
1377 {
1378 return this.getSuperClassifierFacade().getId();
1379 }
1380
1381 /**
1382 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1383 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1384 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1385 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1386 * JDK5 compiler level.
1387 * @see ModelElementFacade#getKeywords()
1388 */
1389 public Collection<String> getKeywords()
1390 {
1391 return this.getSuperClassifierFacade().getKeywords();
1392 }
1393
1394 /**
1395 * UML2: Retrieves a localized label for this named element.
1396 * @see ModelElementFacade#getLabel()
1397 */
1398 public String getLabel()
1399 {
1400 return this.getSuperClassifierFacade().getLabel();
1401 }
1402
1403 /**
1404 * The language mappings that have been set for this model element.
1405 * @see ModelElementFacade#getLanguageMappings()
1406 */
1407 public TypeMappings getLanguageMappings()
1408 {
1409 return this.getSuperClassifierFacade().getLanguageMappings();
1410 }
1411
1412 /**
1413 * Return the model containing this model element (multiple models may be loaded and processed
1414 * at the same time).
1415 * @see ModelElementFacade#getModel()
1416 */
1417 public ModelFacade getModel()
1418 {
1419 return this.getSuperClassifierFacade().getModel();
1420 }
1421
1422 /**
1423 * The name of the model element.
1424 * @see ModelElementFacade#getName()
1425 */
1426 public String getName()
1427 {
1428 return this.getSuperClassifierFacade().getName();
1429 }
1430
1431 /**
1432 * Gets the package to which this model element belongs.
1433 * @see ModelElementFacade#getPackage()
1434 */
1435 public ModelElementFacade getPackage()
1436 {
1437 return this.getSuperClassifierFacade().getPackage();
1438 }
1439
1440 /**
1441 * The name of this model element's package.
1442 * @see ModelElementFacade#getPackageName()
1443 */
1444 public String getPackageName()
1445 {
1446 return this.getSuperClassifierFacade().getPackageName();
1447 }
1448
1449 /**
1450 * Gets the package name (optionally providing the ability to retrieve the model name and not
1451 * the mapped name).
1452 * @see ModelElementFacade#getPackageName(boolean modelName)
1453 */
1454 public String getPackageName(boolean modelName)
1455 {
1456 return this.getSuperClassifierFacade().getPackageName(modelName);
1457 }
1458
1459 /**
1460 * Returns the package as a path, the returned value always starts with out a slash '/'.
1461 * @see ModelElementFacade#getPackagePath()
1462 */
1463 public String getPackagePath()
1464 {
1465 return this.getSuperClassifierFacade().getPackagePath();
1466 }
1467
1468 /**
1469 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1470 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1471 * the names of the containing namespaces starting at the root of the hierarchy and ending with
1472 * the name of the NamedElement itself.
1473 * @see ModelElementFacade#getQualifiedName()
1474 */
1475 public String getQualifiedName()
1476 {
1477 return this.getSuperClassifierFacade().getQualifiedName();
1478 }
1479
1480 /**
1481 * Gets the root package for the model element.
1482 * @see ModelElementFacade#getRootPackage()
1483 */
1484 public PackageFacade getRootPackage()
1485 {
1486 return this.getSuperClassifierFacade().getRootPackage();
1487 }
1488
1489 /**
1490 * Gets the dependencies for which this model element is the source.
1491 * @see ModelElementFacade#getSourceDependencies()
1492 */
1493 public Collection<DependencyFacade> getSourceDependencies()
1494 {
1495 return this.getSuperClassifierFacade().getSourceDependencies();
1496 }
1497
1498 /**
1499 * If this model element is the context of an activity graph, this represents that activity
1500 * graph.
1501 * @see ModelElementFacade#getStateMachineContext()
1502 */
1503 public StateMachineFacade getStateMachineContext()
1504 {
1505 return this.getSuperClassifierFacade().getStateMachineContext();
1506 }
1507
1508 /**
1509 * The collection of ALL stereotype names for this model element.
1510 * @see ModelElementFacade#getStereotypeNames()
1511 */
1512 public Collection<String> getStereotypeNames()
1513 {
1514 return this.getSuperClassifierFacade().getStereotypeNames();
1515 }
1516
1517 /**
1518 * Gets all stereotypes for this model element.
1519 * @see ModelElementFacade#getStereotypes()
1520 */
1521 public Collection<StereotypeFacade> getStereotypes()
1522 {
1523 return this.getSuperClassifierFacade().getStereotypes();
1524 }
1525
1526 /**
1527 * Return the TaggedValues associated with this model element, under all stereotypes.
1528 * @see ModelElementFacade#getTaggedValues()
1529 */
1530 public Collection<TaggedValueFacade> getTaggedValues()
1531 {
1532 return this.getSuperClassifierFacade().getTaggedValues();
1533 }
1534
1535 /**
1536 * Gets the dependencies for which this model element is the target.
1537 * @see ModelElementFacade#getTargetDependencies()
1538 */
1539 public Collection<DependencyFacade> getTargetDependencies()
1540 {
1541 return this.getSuperClassifierFacade().getTargetDependencies();
1542 }
1543
1544 /**
1545 * Get the template parameter for this model element having the parameterName
1546 * @see ModelElementFacade#getTemplateParameter(String parameterName)
1547 */
1548 public Object getTemplateParameter(String parameterName)
1549 {
1550 return this.getSuperClassifierFacade().getTemplateParameter(parameterName);
1551 }
1552
1553 /**
1554 * Get the template parameters for this model element
1555 * @see ModelElementFacade#getTemplateParameters()
1556 */
1557 public Collection<TemplateParameterFacade> getTemplateParameters()
1558 {
1559 return this.getSuperClassifierFacade().getTemplateParameters();
1560 }
1561
1562 /**
1563 * The visibility (i.e. public, private, protected or package) of the model element, will
1564 * attempt a lookup for these values in the language mappings (if any).
1565 * @see ModelElementFacade#getVisibility()
1566 */
1567 public String getVisibility()
1568 {
1569 return this.getSuperClassifierFacade().getVisibility();
1570 }
1571
1572 /**
1573 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1574 * is taken into account when searching for the stereotype), false otherwise.
1575 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1576 */
1577 public boolean hasExactStereotype(String stereotypeName)
1578 {
1579 return this.getSuperClassifierFacade().hasExactStereotype(stereotypeName);
1580 }
1581
1582 /**
1583 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1584 * pipe, semicolon, or << >>
1585 * @see ModelElementFacade#hasKeyword(String keywordName)
1586 */
1587 public boolean hasKeyword(String keywordName)
1588 {
1589 return this.getSuperClassifierFacade().hasKeyword(keywordName);
1590 }
1591
1592 /**
1593 * Returns true if the model element has the specified stereotype. If the stereotype itself
1594 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1595 * one of the stereotype's ancestors has a matching name this method will return true, false
1596 * otherwise.
1597 * For example, if we have a certain stereotype called <<exception>> and a model element has a
1598 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1599 * method with 'stereotypeName' defined as 'exception' the method would return true since
1600 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
1601 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1602 * @see ModelElementFacade#hasStereotype(String stereotypeName)
1603 */
1604 public boolean hasStereotype(String stereotypeName)
1605 {
1606 return this.getSuperClassifierFacade().hasStereotype(stereotypeName);
1607 }
1608
1609 /**
1610 * True if there are target dependencies from this element that are instances of BindingFacade.
1611 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1612 * @see ModelElementFacade#isBindingDependenciesPresent()
1613 */
1614 public boolean isBindingDependenciesPresent()
1615 {
1616 return this.getSuperClassifierFacade().isBindingDependenciesPresent();
1617 }
1618
1619 /**
1620 * Indicates if any constraints are present on this model element.
1621 * @see ModelElementFacade#isConstraintsPresent()
1622 */
1623 public boolean isConstraintsPresent()
1624 {
1625 return this.getSuperClassifierFacade().isConstraintsPresent();
1626 }
1627
1628 /**
1629 * Indicates if any documentation is present on this model element.
1630 * @see ModelElementFacade#isDocumentationPresent()
1631 */
1632 public boolean isDocumentationPresent()
1633 {
1634 return this.getSuperClassifierFacade().isDocumentationPresent();
1635 }
1636
1637 /**
1638 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1639 * @see ModelElementFacade#isReservedWord()
1640 */
1641 public boolean isReservedWord()
1642 {
1643 return this.getSuperClassifierFacade().isReservedWord();
1644 }
1645
1646 /**
1647 * True is there are template parameters on this model element. For UML2, applies to Class,
1648 * Operation, Property, and Parameter.
1649 * @see ModelElementFacade#isTemplateParametersPresent()
1650 */
1651 public boolean isTemplateParametersPresent()
1652 {
1653 return this.getSuperClassifierFacade().isTemplateParametersPresent();
1654 }
1655
1656 /**
1657 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1658 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1659 * Enumerations and Interfaces, optionally applies on other model elements.
1660 * @see ModelElementFacade#isValidIdentifierName()
1661 */
1662 public boolean isValidIdentifierName()
1663 {
1664 return this.getSuperClassifierFacade().isValidIdentifierName();
1665 }
1666
1667 /**
1668 * Searches for the constraint with the specified 'name' on this model element, and if found
1669 * translates it using the specified 'translation' from a translation library discovered by the
1670 * framework.
1671 * @see ModelElementFacade#translateConstraint(String name, String translation)
1672 */
1673 public String translateConstraint(String name, String translation)
1674 {
1675 return this.getSuperClassifierFacade().translateConstraint(name, translation);
1676 }
1677
1678 /**
1679 * Translates all constraints belonging to this model element with the given 'translation'.
1680 * @see ModelElementFacade#translateConstraints(String translation)
1681 */
1682 public String[] translateConstraints(String translation)
1683 {
1684 return this.getSuperClassifierFacade().translateConstraints(translation);
1685 }
1686
1687 /**
1688 * Translates the constraints of the specified 'kind' belonging to this model element.
1689 * @see ModelElementFacade#translateConstraints(String kind, String translation)
1690 */
1691 public String[] translateConstraints(String kind, String translation)
1692 {
1693 return this.getSuperClassifierFacade().translateConstraints(kind, translation);
1694 }
1695
1696 /**
1697 * @see MetafacadeBase#initialize()
1698 */
1699 @Override
1700 public void initialize()
1701 {
1702 this.getSuperClassifierFacade().initialize();
1703 }
1704
1705 /**
1706 * @return Object getSuperClassifierFacade().getValidationOwner()
1707 * @see MetafacadeBase#getValidationOwner()
1708 */
1709 @Override
1710 public Object getValidationOwner()
1711 {
1712 Object owner = this.getSuperClassifierFacade().getValidationOwner();
1713 return owner;
1714 }
1715
1716 /**
1717 * @return String getSuperClassifierFacade().getValidationName()
1718 * @see MetafacadeBase#getValidationName()
1719 */
1720 @Override
1721 public String getValidationName()
1722 {
1723 String name = this.getSuperClassifierFacade().getValidationName();
1724 return name;
1725 }
1726
1727 /**
1728 * <p><b>Constraint:</b> org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only generalize another metafacade</p>
1729 * <p><b>Error:</b> A metafacade can only generalize another metafacade.</p>
1730 * <p><b>OCL:</b> context Metafacade
1731 inv : generalization -> notEmpty() implies generalization.oclIsKindOf(Metafacade)</p>
1732 * <p><b>Constraint:</b> org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only specialize another metafacade</p>
1733 * <p><b>Error:</b> A metafacade can only specialize another metafacade.</p>
1734 * <p><b>OCL:</b> context Metafacade inv :
1735 specializations -> notEmpty() implies specializations -> forAll(oclIsKindOf(Metafacade))</p>
1736 * <p><b>Constraint:</b> org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade must either extend an existing metafacade or have a direct dependency to a metaclass</p>
1737 * <p><b>Error:</b> A metafacade must at the least, either extend an existing metafacade or have a direct dependency to a metaclass.</p>
1738 * <p><b>OCL:</b> context Metafacade
1739 inv: generalizations -> notEmpty() or sourceDependencies -> notEmpty()</p>
1740 * @param validationMessages Collection<ModelValidationMessage>
1741 * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1742 */
1743 @Override
1744 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1745 {
1746 this.getSuperClassifierFacade().validateInvariants(validationMessages);
1747 try
1748 {
1749 final Object contextElement = this.THIS();
1750 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"generalization")))).booleanValue()?OCLIntrospector.invoke(contextElement,"generalization") instanceof Metafacade:true));
1751 if (!constraintValid)
1752 {
1753 validationMessages.add(
1754 new ModelValidationMessage(
1755 (MetafacadeBase)contextElement ,
1756 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only generalize another metafacade",
1757 "A metafacade can only generalize another metafacade."));
1758 }
1759 }
1760 catch (Throwable th)
1761 {
1762 Throwable cause = th.getCause();
1763 int depth = 0; // Some throwables have infinite recursion
1764 while (cause != null && depth < 7)
1765 {
1766 th = cause;
1767 depth++;
1768 }
1769 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only generalize another metafacade' ON "
1770 + this.THIS().toString() + ": " + th.getMessage(), th);
1771 }
1772 try
1773 {
1774 final Object contextElement = this.THIS();
1775 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"specializations")))).booleanValue()?OCLCollections.forAll(OCLIntrospector.invoke(contextElement,"specializations"),new Predicate(){public boolean evaluate(Object object){return Boolean.valueOf(String.valueOf(object instanceof Metafacade)).booleanValue();}}):true));
1776 if (!constraintValid)
1777 {
1778 validationMessages.add(
1779 new ModelValidationMessage(
1780 (MetafacadeBase)contextElement ,
1781 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only specialize another metafacade",
1782 "A metafacade can only specialize another metafacade."));
1783 }
1784 }
1785 catch (Throwable th)
1786 {
1787 Throwable cause = th.getCause();
1788 int depth = 0; // Some throwables have infinite recursion
1789 while (cause != null && depth < 7)
1790 {
1791 th = cause;
1792 depth++;
1793 }
1794 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade can only specialize another metafacade' ON "
1795 + this.THIS().toString() + ": " + th.getMessage(), th);
1796 }
1797 try
1798 {
1799 final Object contextElement = this.THIS();
1800 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"generalizations"))||OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"sourceDependencies")));
1801 if (!constraintValid)
1802 {
1803 validationMessages.add(
1804 new ModelValidationMessage(
1805 (MetafacadeBase)contextElement ,
1806 "org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade must either extend an existing metafacade or have a direct dependency to a metaclass",
1807 "A metafacade must at the least, either extend an existing metafacade or have a direct dependency to a metaclass."));
1808 }
1809 }
1810 catch (Throwable th)
1811 {
1812 Throwable cause = th.getCause();
1813 int depth = 0; // Some throwables have infinite recursion
1814 while (cause != null && depth < 7)
1815 {
1816 th = cause;
1817 depth++;
1818 }
1819 logger.error("Error validating constraint 'org::andromda::cartridges::meta::metafacades::Metafacade::a metafacade must either extend an existing metafacade or have a direct dependency to a metaclass' ON "
1820 + this.THIS().toString() + ": " + th.getMessage(), th);
1821 }
1822 }
1823
1824 /**
1825 * The property that stores the name of the metafacade.
1826 */
1827 private static final String NAME_PROPERTY = "name";
1828 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1829
1830 /**
1831 * @see Object#toString()
1832 */
1833 @Override
1834 public String toString()
1835 {
1836 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1837 toString.append("[");
1838 try
1839 {
1840 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1841 }
1842 catch (final Throwable tryAgain)
1843 {
1844 try
1845 {
1846 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1847 }
1848 catch (final Throwable ignore)
1849 {
1850 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1851 }
1852 }
1853 toString.append("]");
1854 return toString.toString();
1855 }
1856 }