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