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
30 /**
31 * Represents a class in the PSM metamodel which the cartridge writer has in mind. Metafacade
32 * operations in other metafacades will return instances of PSM metaclasses. Code for these
33 * metaclasses is generated by a template which is associated with the PSMmetaclass metafacade.
34 * MetafacadeLogic for PSMmetaclass
35 *
36 * @see PSMmetaclass
37 */
38 public abstract class PSMmetaclassLogic
39 extends MetafacadeBase
40 implements PSMmetaclass
41 {
42 /**
43 * The underlying UML object
44 * @see Object
45 */
46 protected Object metaObject;
47
48 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
49 * @param metaObjectIn
50 * @param context
51 */
52 protected PSMmetaclassLogic(Object metaObjectIn, String context)
53 {
54 super(metaObjectIn, getContext(context));
55 this.superClassifierFacade =
56 (ClassifierFacade)
57 MetafacadeFactory.getInstance().createFacadeImpl(
58 "org.andromda.metafacades.uml.ClassifierFacade",
59 metaObjectIn,
60 getContext(context));
61 this.metaObject = metaObjectIn;
62 }
63
64 /**
65 * Gets the context for this metafacade logic instance.
66 * @param context String. Set to PSMmetaclass if null
67 * @return context String
68 */
69 private static String getContext(String context)
70 {
71 if (context == null)
72 {
73 context = "org.andromda.cartridges.meta.metafacades.PSMmetaclass";
74 }
75 return context;
76 }
77
78 private ClassifierFacade superClassifierFacade;
79 private boolean superClassifierFacadeInitialized = false;
80
81 /**
82 * Gets the ClassifierFacade parent instance.
83 * @return this.superClassifierFacade ClassifierFacade
84 */
85 private ClassifierFacade getSuperClassifierFacade()
86 {
87 if (!this.superClassifierFacadeInitialized)
88 {
89 ((MetafacadeBase)this.superClassifierFacade).setMetafacadeContext(this.getMetafacadeContext());
90 this.superClassifierFacadeInitialized = true;
91 }
92 return this.superClassifierFacade;
93 }
94
95 /** Reset context only for non-root metafacades
96 * @param context
97 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
98 */
99 @Override
100 public void resetMetafacadeContext(String context)
101 {
102 if (!this.contextRoot) // reset context only for non-root metafacades
103 {
104 context = getContext(context); // to have same value as in original constructor call
105 setMetafacadeContext (context);
106 if (this.superClassifierFacadeInitialized)
107 {
108 ((MetafacadeBase)this.superClassifierFacade).resetMetafacadeContext(context);
109 }
110 }
111 }
112
113 /**
114 * @return boolean true always
115 * @see PSMmetaclass
116 */
117 public boolean isPSMmetaclassMetaType()
118 {
119 return true;
120 }
121
122 // --------------- attributes ---------------------
123
124 /**
125 * @see org.andromda.cartridges.meta.metafacades.PSMmetaclass#isOperationsPresent()
126 * @return boolean
127 */
128 protected abstract boolean handleIsOperationsPresent();
129
130 private boolean __operationsPresent1a;
131 private boolean __operationsPresent1aSet = false;
132
133 /**
134 * Indicates whether the class has operations or not. Used to trigger a template for
135 * implementation classes.
136 * @return (boolean)handleIsOperationsPresent()
137 */
138 public final boolean isOperationsPresent()
139 {
140 boolean operationsPresent1a = this.__operationsPresent1a;
141 if (!this.__operationsPresent1aSet)
142 {
143 // operationsPresent has no pre constraints
144 operationsPresent1a = handleIsOperationsPresent();
145 // operationsPresent has no post constraints
146 this.__operationsPresent1a = operationsPresent1a;
147 if (isMetafacadePropertyCachingEnabled())
148 {
149 this.__operationsPresent1aSet = true;
150 }
151 }
152 return operationsPresent1a;
153 }
154
155 /**
156 * @see org.andromda.cartridges.meta.metafacades.PSMmetaclass#isImplMustBeAbstract()
157 * @return boolean
158 */
159 protected abstract boolean handleIsImplMustBeAbstract();
160
161 private boolean __implMustBeAbstract2a;
162 private boolean __implMustBeAbstract2aSet = false;
163
164 /**
165 * TODO: Model Documentation for
166 * org.andromda.cartridges.meta.metafacades.PSMmetaclass.implMustBeAbstract
167 * @return (boolean)handleIsImplMustBeAbstract()
168 */
169 public final boolean isImplMustBeAbstract()
170 {
171 boolean implMustBeAbstract2a = this.__implMustBeAbstract2a;
172 if (!this.__implMustBeAbstract2aSet)
173 {
174 // implMustBeAbstract has no pre constraints
175 implMustBeAbstract2a = handleIsImplMustBeAbstract();
176 // implMustBeAbstract has no post constraints
177 this.__implMustBeAbstract2a = implMustBeAbstract2a;
178 if (isMetafacadePropertyCachingEnabled())
179 {
180 this.__implMustBeAbstract2aSet = true;
181 }
182 }
183 return implMustBeAbstract2a;
184 }
185
186 /**
187 * @return true
188 * @see ClassifierFacade
189 */
190 public boolean isClassifierFacadeMetaType()
191 {
192 return true;
193 }
194
195 /**
196 * @return true
197 * @see GeneralizableElementFacade
198 */
199 public boolean isGeneralizableElementFacadeMetaType()
200 {
201 return true;
202 }
203
204 /**
205 * @return true
206 * @see ModelElementFacade
207 */
208 public boolean isModelElementFacadeMetaType()
209 {
210 return true;
211 }
212
213 // ----------- delegates to ClassifierFacade ------------
214 /**
215 * Return the attribute which name matches the parameter
216 * @see ClassifierFacade#findAttribute(String name)
217 */
218 public AttributeFacade findAttribute(String name)
219 {
220 return this.getSuperClassifierFacade().findAttribute(name);
221 }
222
223 /**
224 * Those abstraction dependencies for which this classifier is the client.
225 * @see ClassifierFacade#getAbstractions()
226 */
227 public Collection<ClassifierFacade> getAbstractions()
228 {
229 return this.getSuperClassifierFacade().getAbstractions();
230 }
231
232 /**
233 * Lists all classes associated to this one and any ancestor classes (through generalization).
234 * There will be no duplicates. The order of the elements is predictable.
235 * @see ClassifierFacade#getAllAssociatedClasses()
236 */
237 public Collection<ClassifierFacade> getAllAssociatedClasses()
238 {
239 return this.getSuperClassifierFacade().getAllAssociatedClasses();
240 }
241
242 /**
243 * A collection containing all 'properties' of the classifier and its ancestors. Properties are
244 * any attributes and navigable connecting association ends.
245 * @see ClassifierFacade#getAllProperties()
246 */
247 public Collection<ModelElementFacade> getAllProperties()
248 {
249 return this.getSuperClassifierFacade().getAllProperties();
250 }
251
252 /**
253 * A collection containing all required and/or read-only 'properties' of the classifier and its
254 * ancestors. Properties are any attributes and navigable connecting association ends.
255 * @see ClassifierFacade#getAllRequiredConstructorParameters()
256 */
257 public Collection<ModelElementFacade> getAllRequiredConstructorParameters()
258 {
259 return this.getSuperClassifierFacade().getAllRequiredConstructorParameters();
260 }
261
262 /**
263 * Gets the array type for this classifier. If this classifier already represents an array, it
264 * just returns itself.
265 * @see ClassifierFacade#getArray()
266 */
267 public ClassifierFacade getArray()
268 {
269 return this.getSuperClassifierFacade().getArray();
270 }
271
272 /**
273 * The name of the classifier as an array.
274 * @see ClassifierFacade#getArrayName()
275 */
276 public String getArrayName()
277 {
278 return this.getSuperClassifierFacade().getArrayName();
279 }
280
281 /**
282 * Lists the classes associated to this one, there is no repitition of classes. The order of the
283 * elements is predictable.
284 * @see ClassifierFacade#getAssociatedClasses()
285 */
286 public Collection<ClassifierFacade> getAssociatedClasses()
287 {
288 return this.getSuperClassifierFacade().getAssociatedClasses();
289 }
290
291 /**
292 * Gets the association ends belonging to a classifier.
293 * @see ClassifierFacade#getAssociationEnds()
294 */
295 public List<AssociationEndFacade> getAssociationEnds()
296 {
297 return this.getSuperClassifierFacade().getAssociationEnds();
298 }
299
300 /**
301 * Gets the attributes that belong to the classifier.
302 * @see ClassifierFacade#getAttributes()
303 */
304 public List<AttributeFacade> getAttributes()
305 {
306 return this.getSuperClassifierFacade().getAttributes();
307 }
308
309 /**
310 * Gets all attributes for the classifier and if 'follow' is true goes up the inheritance
311 * hierarchy and gets the attributes from the super classes as well.
312 * @see ClassifierFacade#getAttributes(boolean follow)
313 */
314 public List<AttributeFacade> getAttributes(boolean follow)
315 {
316 return this.getSuperClassifierFacade().getAttributes(follow);
317 }
318
319 /**
320 * The fully qualified name of the classifier as an array.
321 * @see ClassifierFacade#getFullyQualifiedArrayName()
322 */
323 public String getFullyQualifiedArrayName()
324 {
325 return this.getSuperClassifierFacade().getFullyQualifiedArrayName();
326 }
327
328 /**
329 * Returns all those operations that could be implemented at this classifier's level. This means
330 * the operations owned by this classifier as well as any realized interface's operations
331 * (recursively) in case this classifier itself is not already an interface, or generalized when
332 * this classifier is an interface.
333 * @see ClassifierFacade#getImplementationOperations()
334 */
335 public Collection<OperationFacade> getImplementationOperations()
336 {
337 return this.getSuperClassifierFacade().getImplementationOperations();
338 }
339
340 /**
341 * A comma separated list of the fully qualified names of all implemented interfaces.
342 * @see ClassifierFacade#getImplementedInterfaceList()
343 */
344 public String getImplementedInterfaceList()
345 {
346 return this.getSuperClassifierFacade().getImplementedInterfaceList();
347 }
348
349 /**
350 * Those attributes that are scoped to an instance of this class.
351 * @see ClassifierFacade#getInstanceAttributes()
352 */
353 public Collection<AttributeFacade> getInstanceAttributes()
354 {
355 return this.getSuperClassifierFacade().getInstanceAttributes();
356 }
357
358 /**
359 * Those operations that are scoped to an instance of this class.
360 * @see ClassifierFacade#getInstanceOperations()
361 */
362 public List<OperationFacade> getInstanceOperations()
363 {
364 return this.getSuperClassifierFacade().getInstanceOperations();
365 }
366
367 /**
368 * Those interfaces that are abstractions of this classifier, this basically means this
369 * classifier realizes them.
370 * @see ClassifierFacade#getInterfaceAbstractions()
371 */
372 public Collection<ClassifierFacade> getInterfaceAbstractions()
373 {
374 return this.getSuperClassifierFacade().getInterfaceAbstractions();
375 }
376
377 /**
378 * A String representing a new Constructor declaration for this classifier type to be used in a
379 * Java environment.
380 * @see ClassifierFacade#getJavaNewString()
381 */
382 public String getJavaNewString()
383 {
384 return this.getSuperClassifierFacade().getJavaNewString();
385 }
386
387 /**
388 * A String representing the null-value for this classifier type to be used in a Java
389 * environment.
390 * @see ClassifierFacade#getJavaNullString()
391 */
392 public String getJavaNullString()
393 {
394 return this.getSuperClassifierFacade().getJavaNullString();
395 }
396
397 /**
398 * The other ends of this classifier's association ends which are navigable.
399 * @see ClassifierFacade#getNavigableConnectingEnds()
400 */
401 public Collection<AssociationEndFacade> getNavigableConnectingEnds()
402 {
403 return this.getSuperClassifierFacade().getNavigableConnectingEnds();
404 }
405
406 /**
407 * Get the other ends of this classifier's association ends which are navigable and if 'follow'
408 * is true goes up the inheritance hierarchy and gets the super association ends as well.
409 * @see ClassifierFacade#getNavigableConnectingEnds(boolean follow)
410 */
411 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow)
412 {
413 return this.getSuperClassifierFacade().getNavigableConnectingEnds(follow);
414 }
415
416 /**
417 * Assuming that the classifier is an array, this will return the non array type of the
418 * classifier from
419 * the model. If the classifier is NOT an array, it will just return itself.
420 * @see ClassifierFacade#getNonArray()
421 */
422 public ClassifierFacade getNonArray()
423 {
424 return this.getSuperClassifierFacade().getNonArray();
425 }
426
427 /**
428 * The attributes from this classifier in the form of an operation call (this example would be
429 * in Java): '(String attributeOne, String attributeTwo). If there were no attributes on the
430 * classifier, the result would be an empty '()'.
431 * @see ClassifierFacade#getOperationCallFromAttributes()
432 */
433 public String getOperationCallFromAttributes()
434 {
435 return this.getSuperClassifierFacade().getOperationCallFromAttributes();
436 }
437
438 /**
439 * The operations owned by this classifier.
440 * @see ClassifierFacade#getOperations()
441 */
442 public List<OperationFacade> getOperations()
443 {
444 return this.getSuperClassifierFacade().getOperations();
445 }
446
447 /**
448 * A collection containing all 'properties' of the classifier. Properties are any attributes
449 * and navigable connecting association ends.
450 * @see ClassifierFacade#getProperties()
451 */
452 public List<ModelElementFacade> getProperties()
453 {
454 return this.getSuperClassifierFacade().getProperties();
455 }
456
457 /**
458 * Gets all properties (attributes and navigable association ends) for the classifier and if
459 * 'follow' is true goes up the inheritance hierarchy and gets the properties from the super
460 * classes as well.
461 * @see ClassifierFacade#getProperties(boolean follow)
462 */
463 public List getProperties(boolean follow)
464 {
465 return this.getSuperClassifierFacade().getProperties(follow);
466 }
467
468 /**
469 * A collection containing all required and/or read-only 'properties' of the classifier.
470 * Properties are any attributes and navigable connecting association ends.
471 * @see ClassifierFacade#getRequiredConstructorParameters()
472 */
473 public Collection<ModelElementFacade> getRequiredConstructorParameters()
474 {
475 return this.getSuperClassifierFacade().getRequiredConstructorParameters();
476 }
477
478 /**
479 * Returns the serial version UID of the underlying model element.
480 * @see ClassifierFacade#getSerialVersionUID()
481 */
482 public long getSerialVersionUID()
483 {
484 return this.getSuperClassifierFacade().getSerialVersionUID();
485 }
486
487 /**
488 * Those attributes that are scoped to the definition of this class.
489 * @see ClassifierFacade#getStaticAttributes()
490 */
491 public Collection<AttributeFacade> getStaticAttributes()
492 {
493 return this.getSuperClassifierFacade().getStaticAttributes();
494 }
495
496 /**
497 * Those operations that are scoped to the definition of this class.
498 * @see ClassifierFacade#getStaticOperations()
499 */
500 public List<OperationFacade> getStaticOperations()
501 {
502 return this.getSuperClassifierFacade().getStaticOperations();
503 }
504
505 /**
506 * This class' superclass, returns the generalization if it is a ClassifierFacade, null
507 * otherwise.
508 * @see ClassifierFacade#getSuperClass()
509 */
510 public ClassifierFacade getSuperClass()
511 {
512 return this.getSuperClassifierFacade().getSuperClass();
513 }
514
515 /**
516 * The wrapper name for this classifier if a mapped type has a defined wrapper class (ie. 'long'
517 * maps to 'Long'). If the classifier doesn't have a wrapper defined for it, this method will
518 * return a null. Note that wrapper mappings must be defined for the namespace by defining the
519 * 'wrapperMappingsUri', this property must point to the location of the mappings file which
520 * maps the primitives to wrapper types.
521 * @see ClassifierFacade#getWrapperName()
522 */
523 public String getWrapperName()
524 {
525 return this.getSuperClassifierFacade().getWrapperName();
526 }
527
528 /**
529 * Indicates if this classifier is 'abstract'.
530 * @see ClassifierFacade#isAbstract()
531 */
532 public boolean isAbstract()
533 {
534 return this.getSuperClassifierFacade().isAbstract();
535 }
536
537 /**
538 * True if this classifier represents an array type. False otherwise.
539 * @see ClassifierFacade#isArrayType()
540 */
541 public boolean isArrayType()
542 {
543 return this.getSuperClassifierFacade().isArrayType();
544 }
545
546 /**
547 * True if the ClassifierFacade is an AssociationClass.
548 * @see ClassifierFacade#isAssociationClass()
549 */
550 public boolean isAssociationClass()
551 {
552 return this.getSuperClassifierFacade().isAssociationClass();
553 }
554
555 /**
556 * Returns true if this type represents a Blob type.
557 * @see ClassifierFacade#isBlobType()
558 */
559 public boolean isBlobType()
560 {
561 return this.getSuperClassifierFacade().isBlobType();
562 }
563
564 /**
565 * Indicates if this type represents a boolean type or not.
566 * @see ClassifierFacade#isBooleanType()
567 */
568 public boolean isBooleanType()
569 {
570 return this.getSuperClassifierFacade().isBooleanType();
571 }
572
573 /**
574 * Indicates if this type represents a char, Character, or java.lang.Character type or not.
575 * @see ClassifierFacade#isCharacterType()
576 */
577 public boolean isCharacterType()
578 {
579 return this.getSuperClassifierFacade().isCharacterType();
580 }
581
582 /**
583 * Returns true if this type represents a Clob type.
584 * @see ClassifierFacade#isClobType()
585 */
586 public boolean isClobType()
587 {
588 return this.getSuperClassifierFacade().isClobType();
589 }
590
591 /**
592 * True if this classifier represents a collection type. False otherwise.
593 * @see ClassifierFacade#isCollectionType()
594 */
595 public boolean isCollectionType()
596 {
597 return this.getSuperClassifierFacade().isCollectionType();
598 }
599
600 /**
601 * True/false depending on whether or not this classifier represents a datatype. A data type is
602 * a type whose instances are identified only by their value. A data type may contain attributes
603 * to support the modeling of structured data types.
604 * @see ClassifierFacade#isDataType()
605 */
606 public boolean isDataType()
607 {
608 return this.getSuperClassifierFacade().isDataType();
609 }
610
611 /**
612 * True when this classifier is a date type.
613 * @see ClassifierFacade#isDateType()
614 */
615 public boolean isDateType()
616 {
617 return this.getSuperClassifierFacade().isDateType();
618 }
619
620 /**
621 * Indicates if this type represents a Double type or not.
622 * @see ClassifierFacade#isDoubleType()
623 */
624 public boolean isDoubleType()
625 {
626 return this.getSuperClassifierFacade().isDoubleType();
627 }
628
629 /**
630 * Indicates whether or not this classifier represents an "EmbeddedValue'.
631 * @see ClassifierFacade#isEmbeddedValue()
632 */
633 public boolean isEmbeddedValue()
634 {
635 return this.getSuperClassifierFacade().isEmbeddedValue();
636 }
637
638 /**
639 * True if this classifier is in fact marked as an enumeration.
640 * @see ClassifierFacade#isEnumeration()
641 */
642 public boolean isEnumeration()
643 {
644 return this.getSuperClassifierFacade().isEnumeration();
645 }
646
647 /**
648 * Returns true if this type represents a 'file' type.
649 * @see ClassifierFacade#isFileType()
650 */
651 public boolean isFileType()
652 {
653 return this.getSuperClassifierFacade().isFileType();
654 }
655
656 /**
657 * Indicates if this type represents a Float type or not.
658 * @see ClassifierFacade#isFloatType()
659 */
660 public boolean isFloatType()
661 {
662 return this.getSuperClassifierFacade().isFloatType();
663 }
664
665 /**
666 * Indicates if this type represents an int or Integer or java.lang.Integer type or not.
667 * @see ClassifierFacade#isIntegerType()
668 */
669 public boolean isIntegerType()
670 {
671 return this.getSuperClassifierFacade().isIntegerType();
672 }
673
674 /**
675 * True/false depending on whether or not this Classifier represents an interface.
676 * @see ClassifierFacade#isInterface()
677 */
678 public boolean isInterface()
679 {
680 return this.getSuperClassifierFacade().isInterface();
681 }
682
683 /**
684 * True if this classifier cannot be extended and represent a leaf in the inheritance tree.
685 * @see ClassifierFacade#isLeaf()
686 */
687 public boolean isLeaf()
688 {
689 return this.getSuperClassifierFacade().isLeaf();
690 }
691
692 /**
693 * True if this classifier represents a list type. False otherwise.
694 * @see ClassifierFacade#isListType()
695 */
696 public boolean isListType()
697 {
698 return this.getSuperClassifierFacade().isListType();
699 }
700
701 /**
702 * Indicates if this type represents a Long type or not.
703 * @see ClassifierFacade#isLongType()
704 */
705 public boolean isLongType()
706 {
707 return this.getSuperClassifierFacade().isLongType();
708 }
709
710 /**
711 * Indicates whether or not this classifier represents a Map type.
712 * @see ClassifierFacade#isMapType()
713 */
714 public boolean isMapType()
715 {
716 return this.getSuperClassifierFacade().isMapType();
717 }
718
719 /**
720 * Indicates whether or not this classifier represents a primitive type.
721 * @see ClassifierFacade#isPrimitive()
722 */
723 public boolean isPrimitive()
724 {
725 return this.getSuperClassifierFacade().isPrimitive();
726 }
727
728 /**
729 * True if this classifier represents a set type. False otherwise.
730 * @see ClassifierFacade#isSetType()
731 */
732 public boolean isSetType()
733 {
734 return this.getSuperClassifierFacade().isSetType();
735 }
736
737 /**
738 * Indicates whether or not this classifier represents a string type.
739 * @see ClassifierFacade#isStringType()
740 */
741 public boolean isStringType()
742 {
743 return this.getSuperClassifierFacade().isStringType();
744 }
745
746 /**
747 * Indicates whether or not this classifier represents a time type.
748 * @see ClassifierFacade#isTimeType()
749 */
750 public boolean isTimeType()
751 {
752 return this.getSuperClassifierFacade().isTimeType();
753 }
754
755 /**
756 * Returns true if this type is a wrapped primitive type.
757 * @see ClassifierFacade#isWrappedPrimitive()
758 */
759 public boolean isWrappedPrimitive()
760 {
761 return this.getSuperClassifierFacade().isWrappedPrimitive();
762 }
763
764 /**
765 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set
766 * to true.
767 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow)
768 */
769 public Object findTaggedValue(String tagName, boolean follow)
770 {
771 return this.getSuperClassifierFacade().findTaggedValue(tagName, follow);
772 }
773
774 /**
775 * All generalizations for this generalizable element, goes up the inheritance tree.
776 * @see GeneralizableElementFacade#getAllGeneralizations()
777 */
778 public Collection<GeneralizableElementFacade> getAllGeneralizations()
779 {
780 return this.getSuperClassifierFacade().getAllGeneralizations();
781 }
782
783 /**
784 * All specializations (travels down the inheritance hierarchy).
785 * @see GeneralizableElementFacade#getAllSpecializations()
786 */
787 public Collection<GeneralizableElementFacade> getAllSpecializations()
788 {
789 return this.getSuperClassifierFacade().getAllSpecializations();
790 }
791
792 /**
793 * Gets the direct generalization for this generalizable element.
794 * @see GeneralizableElementFacade#getGeneralization()
795 */
796 public GeneralizableElementFacade getGeneralization()
797 {
798 return this.getSuperClassifierFacade().getGeneralization();
799 }
800
801 /**
802 * Gets the actual links that this generalization element is part of (it plays either the
803 * specialization or generalization).
804 * @see GeneralizableElementFacade#getGeneralizationLinks()
805 */
806 public Collection<GeneralizationFacade> getGeneralizationLinks()
807 {
808 return this.getSuperClassifierFacade().getGeneralizationLinks();
809 }
810
811 /**
812 * A comma separated list of the fully qualified names of all generalizations.
813 * @see GeneralizableElementFacade#getGeneralizationList()
814 */
815 public String getGeneralizationList()
816 {
817 return this.getSuperClassifierFacade().getGeneralizationList();
818 }
819
820 /**
821 * The element found when you recursively follow the generalization path up to the root. If an
822 * element has no generalization itself will be considered the root.
823 * @see GeneralizableElementFacade#getGeneralizationRoot()
824 */
825 public GeneralizableElementFacade getGeneralizationRoot()
826 {
827 return this.getSuperClassifierFacade().getGeneralizationRoot();
828 }
829
830 /**
831 * Return all generalizations (ancestors) from this generalizable element.
832 * @see GeneralizableElementFacade#getGeneralizations()
833 */
834 public Collection<GeneralizableElementFacade> getGeneralizations()
835 {
836 return this.getSuperClassifierFacade().getGeneralizations();
837 }
838
839 /**
840 * Gets the direct specializations (i.e. sub elements) for this generalizatble element.
841 * @see GeneralizableElementFacade#getSpecializations()
842 */
843 public Collection<GeneralizableElementFacade> getSpecializations()
844 {
845 return this.getSuperClassifierFacade().getSpecializations();
846 }
847
848 /**
849 * Copies all tagged values from the given ModelElementFacade to this model element facade.
850 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
851 */
852 public void copyTaggedValues(ModelElementFacade element)
853 {
854 this.getSuperClassifierFacade().copyTaggedValues(element);
855 }
856
857 /**
858 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
859 * one found will be returned.
860 * @see ModelElementFacade#findTaggedValue(String tagName)
861 */
862 public Object findTaggedValue(String tagName)
863 {
864 return this.getSuperClassifierFacade().findTaggedValue(tagName);
865 }
866
867 /**
868 * Returns all the values for the tagged value with the specified name. The returned collection
869 * will contains only String instances, or will be empty. Never null.
870 * @see ModelElementFacade#findTaggedValues(String tagName)
871 */
872 public Collection<Object> findTaggedValues(String tagName)
873 {
874 return this.getSuperClassifierFacade().findTaggedValues(tagName);
875 }
876
877 /**
878 * Returns the fully qualified name of the model element. The fully qualified name includes
879 * complete package qualified name of the underlying model element. The templates parameter will
880 * be replaced by the correct one given the binding relation of the parameter to this element.
881 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
882 */
883 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
884 {
885 return this.getSuperClassifierFacade().getBindedFullyQualifiedName(bindedElement);
886 }
887
888 /**
889 * Gets all constraints belonging to the model element.
890 * @see ModelElementFacade#getConstraints()
891 */
892 public Collection<ConstraintFacade> getConstraints()
893 {
894 return this.getSuperClassifierFacade().getConstraints();
895 }
896
897 /**
898 * Returns the constraints of the argument kind that have been placed onto this model. Typical
899 * kinds are "inv", "pre" and "post". Other kinds are possible.
900 * @see ModelElementFacade#getConstraints(String kind)
901 */
902 public Collection<ConstraintFacade> getConstraints(String kind)
903 {
904 return this.getSuperClassifierFacade().getConstraints(kind);
905 }
906
907 /**
908 * Gets the documentation for the model element, The indent argument is prefixed to each line.
909 * By default this method wraps lines after 64 characters.
910 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
911 * @see ModelElementFacade#getDocumentation(String indent)
912 */
913 public String getDocumentation(String indent)
914 {
915 return this.getSuperClassifierFacade().getDocumentation(indent);
916 }
917
918 /**
919 * This method returns the documentation for this model element, with the lines wrapped after
920 * the specified number of characters, values of less than 1 will indicate no line wrapping is
921 * required. By default paragraphs are returned as HTML.
922 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
923 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
924 */
925 public String getDocumentation(String indent, int lineLength)
926 {
927 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength);
928 }
929
930 /**
931 * This method returns the documentation for this model element, with the lines wrapped after
932 * the specified number of characters, values of less than 1 will indicate no line wrapping is
933 * required. HTML style determines if HTML Escaping is applied.
934 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
935 */
936 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
937 {
938 return this.getSuperClassifierFacade().getDocumentation(indent, lineLength, htmlStyle);
939 }
940
941 /**
942 * The fully qualified name of this model element.
943 * @see ModelElementFacade#getFullyQualifiedName()
944 */
945 public String getFullyQualifiedName()
946 {
947 return this.getSuperClassifierFacade().getFullyQualifiedName();
948 }
949
950 /**
951 * Returns the fully qualified name of the model element. The fully qualified name includes
952 * complete package qualified name of the underlying model element. If modelName is true, then
953 * the original name of the model element (the name contained within the model) will be the name
954 * returned, otherwise a name from a language mapping will be returned.
955 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
956 */
957 public String getFullyQualifiedName(boolean modelName)
958 {
959 return this.getSuperClassifierFacade().getFullyQualifiedName(modelName);
960 }
961
962 /**
963 * Returns the fully qualified name as a path, the returned value always starts with out a slash
964 * '/'.
965 * @see ModelElementFacade#getFullyQualifiedNamePath()
966 */
967 public String getFullyQualifiedNamePath()
968 {
969 return this.getSuperClassifierFacade().getFullyQualifiedNamePath();
970 }
971
972 /**
973 * Gets the unique identifier of the underlying model element.
974 * @see ModelElementFacade#getId()
975 */
976 public String getId()
977 {
978 return this.getSuperClassifierFacade().getId();
979 }
980
981 /**
982 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
983 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
984 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
985 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
986 * JDK5 compiler level.
987 * @see ModelElementFacade#getKeywords()
988 */
989 public Collection<String> getKeywords()
990 {
991 return this.getSuperClassifierFacade().getKeywords();
992 }
993
994 /**
995 * UML2: Retrieves a localized label for this named element.
996 * @see ModelElementFacade#getLabel()
997 */
998 public String getLabel()
999 {
1000 return this.getSuperClassifierFacade().getLabel();
1001 }
1002
1003 /**
1004 * The language mappings that have been set for this model element.
1005 * @see ModelElementFacade#getLanguageMappings()
1006 */
1007 public TypeMappings getLanguageMappings()
1008 {
1009 return this.getSuperClassifierFacade().getLanguageMappings();
1010 }
1011
1012 /**
1013 * Return the model containing this model element (multiple models may be loaded and processed
1014 * at the same time).
1015 * @see ModelElementFacade#getModel()
1016 */
1017 public ModelFacade getModel()
1018 {
1019 return this.getSuperClassifierFacade().getModel();
1020 }
1021
1022 /**
1023 * The name of the model element.
1024 * @see ModelElementFacade#getName()
1025 */
1026 public String getName()
1027 {
1028 return this.getSuperClassifierFacade().getName();
1029 }
1030
1031 /**
1032 * Gets the package to which this model element belongs.
1033 * @see ModelElementFacade#getPackage()
1034 */
1035 public ModelElementFacade getPackage()
1036 {
1037 return this.getSuperClassifierFacade().getPackage();
1038 }
1039
1040 /**
1041 * The name of this model element's package.
1042 * @see ModelElementFacade#getPackageName()
1043 */
1044 public String getPackageName()
1045 {
1046 return this.getSuperClassifierFacade().getPackageName();
1047 }
1048
1049 /**
1050 * Gets the package name (optionally providing the ability to retrieve the model name and not
1051 * the mapped name).
1052 * @see ModelElementFacade#getPackageName(boolean modelName)
1053 */
1054 public String getPackageName(boolean modelName)
1055 {
1056 return this.getSuperClassifierFacade().getPackageName(modelName);
1057 }
1058
1059 /**
1060 * Returns the package as a path, the returned value always starts with out a slash '/'.
1061 * @see ModelElementFacade#getPackagePath()
1062 */
1063 public String getPackagePath()
1064 {
1065 return this.getSuperClassifierFacade().getPackagePath();
1066 }
1067
1068 /**
1069 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1070 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1071 * the names of the containing namespaces starting at the root of the hierarchy and ending with
1072 * the name of the NamedElement itself.
1073 * @see ModelElementFacade#getQualifiedName()
1074 */
1075 public String getQualifiedName()
1076 {
1077 return this.getSuperClassifierFacade().getQualifiedName();
1078 }
1079
1080 /**
1081 * Gets the root package for the model element.
1082 * @see ModelElementFacade#getRootPackage()
1083 */
1084 public PackageFacade getRootPackage()
1085 {
1086 return this.getSuperClassifierFacade().getRootPackage();
1087 }
1088
1089 /**
1090 * Gets the dependencies for which this model element is the source.
1091 * @see ModelElementFacade#getSourceDependencies()
1092 */
1093 public Collection<DependencyFacade> getSourceDependencies()
1094 {
1095 return this.getSuperClassifierFacade().getSourceDependencies();
1096 }
1097
1098 /**
1099 * If this model element is the context of an activity graph, this represents that activity
1100 * graph.
1101 * @see ModelElementFacade#getStateMachineContext()
1102 */
1103 public StateMachineFacade getStateMachineContext()
1104 {
1105 return this.getSuperClassifierFacade().getStateMachineContext();
1106 }
1107
1108 /**
1109 * The collection of ALL stereotype names for this model element.
1110 * @see ModelElementFacade#getStereotypeNames()
1111 */
1112 public Collection<String> getStereotypeNames()
1113 {
1114 return this.getSuperClassifierFacade().getStereotypeNames();
1115 }
1116
1117 /**
1118 * Gets all stereotypes for this model element.
1119 * @see ModelElementFacade#getStereotypes()
1120 */
1121 public Collection<StereotypeFacade> getStereotypes()
1122 {
1123 return this.getSuperClassifierFacade().getStereotypes();
1124 }
1125
1126 /**
1127 * Return the TaggedValues associated with this model element, under all stereotypes.
1128 * @see ModelElementFacade#getTaggedValues()
1129 */
1130 public Collection<TaggedValueFacade> getTaggedValues()
1131 {
1132 return this.getSuperClassifierFacade().getTaggedValues();
1133 }
1134
1135 /**
1136 * Gets the dependencies for which this model element is the target.
1137 * @see ModelElementFacade#getTargetDependencies()
1138 */
1139 public Collection<DependencyFacade> getTargetDependencies()
1140 {
1141 return this.getSuperClassifierFacade().getTargetDependencies();
1142 }
1143
1144 /**
1145 * Get the template parameter for this model element having the parameterName
1146 * @see ModelElementFacade#getTemplateParameter(String parameterName)
1147 */
1148 public Object getTemplateParameter(String parameterName)
1149 {
1150 return this.getSuperClassifierFacade().getTemplateParameter(parameterName);
1151 }
1152
1153 /**
1154 * Get the template parameters for this model element
1155 * @see ModelElementFacade#getTemplateParameters()
1156 */
1157 public Collection<TemplateParameterFacade> getTemplateParameters()
1158 {
1159 return this.getSuperClassifierFacade().getTemplateParameters();
1160 }
1161
1162 /**
1163 * The visibility (i.e. public, private, protected or package) of the model element, will
1164 * attempt a lookup for these values in the language mappings (if any).
1165 * @see ModelElementFacade#getVisibility()
1166 */
1167 public String getVisibility()
1168 {
1169 return this.getSuperClassifierFacade().getVisibility();
1170 }
1171
1172 /**
1173 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1174 * is taken into account when searching for the stereotype), false otherwise.
1175 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1176 */
1177 public boolean hasExactStereotype(String stereotypeName)
1178 {
1179 return this.getSuperClassifierFacade().hasExactStereotype(stereotypeName);
1180 }
1181
1182 /**
1183 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1184 * pipe, semicolon, or << >>
1185 * @see ModelElementFacade#hasKeyword(String keywordName)
1186 */
1187 public boolean hasKeyword(String keywordName)
1188 {
1189 return this.getSuperClassifierFacade().hasKeyword(keywordName);
1190 }
1191
1192 /**
1193 * Returns true if the model element has the specified stereotype. If the stereotype itself
1194 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1195 * one of the stereotype's ancestors has a matching name this method will return true, false
1196 * otherwise.
1197 * For example, if we have a certain stereotype called <<exception>> and a model element has a
1198 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1199 * method with 'stereotypeName' defined as 'exception' the method would return true since
1200 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
1201 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1202 * @see ModelElementFacade#hasStereotype(String stereotypeName)
1203 */
1204 public boolean hasStereotype(String stereotypeName)
1205 {
1206 return this.getSuperClassifierFacade().hasStereotype(stereotypeName);
1207 }
1208
1209 /**
1210 * True if there are target dependencies from this element that are instances of BindingFacade.
1211 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1212 * @see ModelElementFacade#isBindingDependenciesPresent()
1213 */
1214 public boolean isBindingDependenciesPresent()
1215 {
1216 return this.getSuperClassifierFacade().isBindingDependenciesPresent();
1217 }
1218
1219 /**
1220 * Indicates if any constraints are present on this model element.
1221 * @see ModelElementFacade#isConstraintsPresent()
1222 */
1223 public boolean isConstraintsPresent()
1224 {
1225 return this.getSuperClassifierFacade().isConstraintsPresent();
1226 }
1227
1228 /**
1229 * Indicates if any documentation is present on this model element.
1230 * @see ModelElementFacade#isDocumentationPresent()
1231 */
1232 public boolean isDocumentationPresent()
1233 {
1234 return this.getSuperClassifierFacade().isDocumentationPresent();
1235 }
1236
1237 /**
1238 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1239 * @see ModelElementFacade#isReservedWord()
1240 */
1241 public boolean isReservedWord()
1242 {
1243 return this.getSuperClassifierFacade().isReservedWord();
1244 }
1245
1246 /**
1247 * True is there are template parameters on this model element. For UML2, applies to Class,
1248 * Operation, Property, and Parameter.
1249 * @see ModelElementFacade#isTemplateParametersPresent()
1250 */
1251 public boolean isTemplateParametersPresent()
1252 {
1253 return this.getSuperClassifierFacade().isTemplateParametersPresent();
1254 }
1255
1256 /**
1257 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1258 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1259 * Enumerations and Interfaces, optionally applies on other model elements.
1260 * @see ModelElementFacade#isValidIdentifierName()
1261 */
1262 public boolean isValidIdentifierName()
1263 {
1264 return this.getSuperClassifierFacade().isValidIdentifierName();
1265 }
1266
1267 /**
1268 * Searches for the constraint with the specified 'name' on this model element, and if found
1269 * translates it using the specified 'translation' from a translation library discovered by the
1270 * framework.
1271 * @see ModelElementFacade#translateConstraint(String name, String translation)
1272 */
1273 public String translateConstraint(String name, String translation)
1274 {
1275 return this.getSuperClassifierFacade().translateConstraint(name, translation);
1276 }
1277
1278 /**
1279 * Translates all constraints belonging to this model element with the given 'translation'.
1280 * @see ModelElementFacade#translateConstraints(String translation)
1281 */
1282 public String[] translateConstraints(String translation)
1283 {
1284 return this.getSuperClassifierFacade().translateConstraints(translation);
1285 }
1286
1287 /**
1288 * Translates the constraints of the specified 'kind' belonging to this model element.
1289 * @see ModelElementFacade#translateConstraints(String kind, String translation)
1290 */
1291 public String[] translateConstraints(String kind, String translation)
1292 {
1293 return this.getSuperClassifierFacade().translateConstraints(kind, translation);
1294 }
1295
1296 /**
1297 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
1298 */
1299 @Override
1300 public void initialize()
1301 {
1302 this.getSuperClassifierFacade().initialize();
1303 }
1304
1305 /**
1306 * @return Object getSuperClassifierFacade().getValidationOwner()
1307 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
1308 */
1309 @Override
1310 public Object getValidationOwner()
1311 {
1312 Object owner = this.getSuperClassifierFacade().getValidationOwner();
1313 return owner;
1314 }
1315
1316 /**
1317 * @return String getSuperClassifierFacade().getValidationName()
1318 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
1319 */
1320 @Override
1321 public String getValidationName()
1322 {
1323 String name = this.getSuperClassifierFacade().getValidationName();
1324 return name;
1325 }
1326
1327 /**
1328 * @param validationMessages Collection<ModelValidationMessage>
1329 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
1330 */
1331 @Override
1332 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1333 {
1334 this.getSuperClassifierFacade().validateInvariants(validationMessages);
1335 }
1336
1337 /**
1338 * The property that stores the name of the metafacade.
1339 */
1340 private static final String NAME_PROPERTY = "name";
1341 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1342
1343 /**
1344 * @see Object#toString()
1345 */
1346 @Override
1347 public String toString()
1348 {
1349 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1350 toString.append("[");
1351 try
1352 {
1353 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1354 }
1355 catch (final Throwable tryAgain)
1356 {
1357 try
1358 {
1359 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1360 }
1361 catch (final Throwable ignore)
1362 {
1363 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1364 }
1365 }
1366 toString.append("]");
1367 return toString.toString();
1368 }
1369 }