1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.xmlschema.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.AssociationEndFacade;
13 import org.andromda.metafacades.uml.AssociationFacade;
14 import org.andromda.metafacades.uml.ClassifierFacade;
15 import org.andromda.metafacades.uml.ConstraintFacade;
16 import org.andromda.metafacades.uml.DependencyFacade;
17 import org.andromda.metafacades.uml.ModelElementFacade;
18 import org.andromda.metafacades.uml.ModelFacade;
19 import org.andromda.metafacades.uml.PackageFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25
26 /**
27 * Can be either an XSD attribute or element.
28 * MetafacadeLogic for XSDAssociationEnd
29 *
30 * @see XSDAssociationEnd
31 */
32 public abstract class XSDAssociationEndLogic
33 extends MetafacadeBase
34 implements XSDAssociationEnd
35 {
36 /**
37 * The underlying UML object
38 * @see Object
39 */
40 protected Object metaObject;
41
42 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
43 * @param metaObjectIn
44 * @param context
45 */
46 protected XSDAssociationEndLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superAssociationEndFacade =
50 (AssociationEndFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.AssociationEndFacade",
53 metaObjectIn,
54 getContext(context));
55 this.metaObject = metaObjectIn;
56 }
57
58 /**
59 * Gets the context for this metafacade logic instance.
60 * @param context String. Set to XSDAssociationEnd if null
61 * @return context String
62 */
63 private static String getContext(String context)
64 {
65 if (context == null)
66 {
67 context = "org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd";
68 }
69 return context;
70 }
71
72 private AssociationEndFacade superAssociationEndFacade;
73 private boolean superAssociationEndFacadeInitialized = false;
74
75 /**
76 * Gets the AssociationEndFacade parent instance.
77 * @return this.superAssociationEndFacade AssociationEndFacade
78 */
79 private AssociationEndFacade getSuperAssociationEndFacade()
80 {
81 if (!this.superAssociationEndFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superAssociationEndFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superAssociationEndFacadeInitialized = true;
85 }
86 return this.superAssociationEndFacade;
87 }
88
89 /** Reset context only for non-root metafacades
90 * @param context
91 * @see org.andromda.core.metafacade.MetafacadeBase#resetMetafacadeContext(String context)
92 */
93 @Override
94 public void resetMetafacadeContext(String context)
95 {
96 if (!this.contextRoot) // reset context only for non-root metafacades
97 {
98 context = getContext(context); // to have same value as in original constructor call
99 setMetafacadeContext (context);
100 if (this.superAssociationEndFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superAssociationEndFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107 /**
108 * @return boolean true always
109 * @see XSDAssociationEnd
110 */
111 public boolean isXSDAssociationEndMetaType()
112 {
113 return true;
114 }
115
116 // --------------- attributes ---------------------
117
118 /**
119 * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#isOwnerSchemaType()
120 * @return boolean
121 */
122 protected abstract boolean handleIsOwnerSchemaType();
123
124 /**
125 * Indicates whether or not the owner is a schema type.
126 * @return (boolean)handleIsOwnerSchemaType()
127 */
128 public final boolean isOwnerSchemaType()
129 {
130 boolean ownerSchemaType1a = false;
131 // ownerSchemaType has no pre constraints
132 ownerSchemaType1a = handleIsOwnerSchemaType();
133 // ownerSchemaType has no post constraints
134 return ownerSchemaType1a;
135 }
136
137 // ---------------- business methods ----------------------
138
139 /**
140 * Method to be implemented in descendants
141 * Gets the maximum amount this element can occur within an XML Schema complex type (if the
142 * object represents an attribute this value will be null).
143 * @return String
144 */
145 protected abstract String handleGetMaxOccurs();
146
147 /**
148 * Gets the maximum amount this element can occur within an XML Schema complex type (if the
149 * object represents an attribute this value will be null).
150 * @return handleGetMaxOccurs()
151 */
152 public String getMaxOccurs()
153 {
154 // getMaxOccurs has no pre constraints
155 String returnValue = handleGetMaxOccurs();
156 // getMaxOccurs has no post constraints
157 return returnValue;
158 }
159
160 /**
161 * Method to be implemented in descendants
162 * Returns the minimum amount that this object can occur with an XML Schema complex type (if the
163 * object represents an attribute this value will be null).
164 * @return String
165 */
166 protected abstract String handleGetMinOccurs();
167
168 /**
169 * Returns the minimum amount that this object can occur with an XML Schema complex type (if the
170 * object represents an attribute this value will be null).
171 * @return handleGetMinOccurs()
172 */
173 public String getMinOccurs()
174 {
175 // getMinOccurs has no pre constraints
176 String returnValue = handleGetMinOccurs();
177 // getMinOccurs has no post constraints
178 return returnValue;
179 }
180
181 /**
182 * @return true
183 * @see AssociationEndFacade
184 */
185 public boolean isAssociationEndFacadeMetaType()
186 {
187 return true;
188 }
189
190 /**
191 * @return true
192 * @see ModelElementFacade
193 */
194 public boolean isModelElementFacadeMetaType()
195 {
196 return true;
197 }
198
199 // ----------- delegates to AssociationEndFacade ------------
200 /**
201 * A name suitable for use when adding new elements to this association end in programming code.
202 * @see AssociationEndFacade#getAdderName()
203 */
204 public String getAdderName()
205 {
206 return this.getSuperAssociationEndFacade().getAdderName();
207 }
208
209 /**
210 * Returns the value of the 'Aggregation' attribute (none, shared, composite). The default value
211 * is "none". The literals are from the enumeration org.eclipse.uml2.uml.AggregationKind.
212 * Specifies the kind of aggregation that applies to the Property.
213 * @see AssociationEndFacade#getAggregationKind()
214 */
215 public String getAggregationKind()
216 {
217 return this.getSuperAssociationEndFacade().getAggregationKind();
218 }
219
220 /**
221 * The association owning this association end.
222 * @see AssociationEndFacade#getAssociation()
223 */
224 public AssociationFacade getAssociation()
225 {
226 return this.getSuperAssociationEndFacade().getAssociation();
227 }
228
229 /**
230 * UML2: Returns the value of the 'Default' attribute. Specifies a String that represents a
231 * value to be used when no argument is supplied for the Property. A String that is evaluated to
232 * give a default value for the Property when an object of the owning Classifier is
233 * instantiated. Can be something like: new ValueObject(values);
234 * @see AssociationEndFacade#getDefault()
235 */
236 public String getDefault()
237 {
238 return this.getSuperAssociationEndFacade().getDefault();
239 }
240
241 /**
242 * A name suitable for use when accessing this association end in programming code.
243 * @see AssociationEndFacade#getGetterName()
244 */
245 public String getGetterName()
246 {
247 return this.getSuperAssociationEndFacade().getGetterName();
248 }
249
250 /**
251 * The name of the type that is returned on the accessor and mutator operations, determined in
252 * part by the multiplicity.
253 * @see AssociationEndFacade#getGetterSetterTypeName()
254 */
255 public String getGetterSetterTypeName()
256 {
257 return this.getSuperAssociationEndFacade().getGetterSetterTypeName();
258 }
259
260 /**
261 * the lower value for the multiplicity
262 * -only applicable for UML2
263 * @see AssociationEndFacade#getLower()
264 */
265 public int getLower()
266 {
267 return this.getSuperAssociationEndFacade().getLower();
268 }
269
270 /**
271 * The other association end owned by this end's association.
272 * @see AssociationEndFacade#getOtherEnd()
273 */
274 public AssociationEndFacade getOtherEnd()
275 {
276 return this.getSuperAssociationEndFacade().getOtherEnd();
277 }
278
279 /**
280 * A name suitable for use when removing element from this association end in programming code.
281 * @see AssociationEndFacade#getRemoverName()
282 */
283 public String getRemoverName()
284 {
285 return this.getSuperAssociationEndFacade().getRemoverName();
286 }
287
288 /**
289 * A name suitable for use when accessing this association end in programming code.
290 * @see AssociationEndFacade#getSetterName()
291 */
292 public String getSetterName()
293 {
294 return this.getSuperAssociationEndFacade().getSetterName();
295 }
296
297 /**
298 * The classifier attached to this association end.
299 * @see AssociationEndFacade#getType()
300 */
301 public ClassifierFacade getType()
302 {
303 return this.getSuperAssociationEndFacade().getType();
304 }
305
306 /**
307 * the upper value for the multiplicity (will be -1 for *)
308 * -only applicable for UML2
309 * @see AssociationEndFacade#getUpper()
310 */
311 public int getUpper()
312 {
313 return this.getSuperAssociationEndFacade().getUpper();
314 }
315
316 /**
317 * True if this association end represents an aggregation relationship.
318 * @see AssociationEndFacade#isAggregation()
319 */
320 public boolean isAggregation()
321 {
322 return this.getSuperAssociationEndFacade().isAggregation();
323 }
324
325 /**
326 * Is true if update of one side of the association should also update the other side. false if
327 * not.
328 * @see AssociationEndFacade#isBidirectional()
329 */
330 public boolean isBidirectional()
331 {
332 return this.getSuperAssociationEndFacade().isBidirectional();
333 }
334
335 /**
336 * Returns whether or not (true/false) this association end is the child end of the assocation
337 * (i.e. the other end's aggregation is composition).
338 * @see AssociationEndFacade#isChild()
339 */
340 public boolean isChild()
341 {
342 return this.getSuperAssociationEndFacade().isChild();
343 }
344
345 /**
346 * True if this association end represents a composition relationship.
347 * @see AssociationEndFacade#isComposition()
348 */
349 public boolean isComposition()
350 {
351 return this.getSuperAssociationEndFacade().isComposition();
352 }
353
354 /**
355 * If the association end is derived (its value is computed). UML2 only. UML14 always returns
356 * false. Default=false.
357 * @see AssociationEndFacade#isDerived()
358 */
359 public boolean isDerived()
360 {
361 return this.getSuperAssociationEndFacade().isDerived();
362 }
363
364 /**
365 * IsLeaf property in the association end property. If true, attribute is final, cannot be
366 * extended or implemented by a descendant. Default=false.
367 * @see AssociationEndFacade#isLeaf()
368 */
369 public boolean isLeaf()
370 {
371 return this.getSuperAssociationEndFacade().isLeaf();
372 }
373
374 /**
375 * True if this association end's multiplicity is greater than one.
376 * @see AssociationEndFacade#isMany()
377 */
378 public boolean isMany()
379 {
380 return this.getSuperAssociationEndFacade().isMany();
381 }
382
383 /**
384 * True if this association end's and the other end's multiplicities are both many.
385 * @see AssociationEndFacade#isMany2Many()
386 */
387 public boolean isMany2Many()
388 {
389 return this.getSuperAssociationEndFacade().isMany2Many();
390 }
391
392 /**
393 * True if this association end's multiplicity is many while the other end's is one.
394 * @see AssociationEndFacade#isMany2One()
395 */
396 public boolean isMany2One()
397 {
398 return this.getSuperAssociationEndFacade().isMany2One();
399 }
400
401 /**
402 * True if it is possible to navigate from the other end to this association end .
403 * @see AssociationEndFacade#isNavigable()
404 */
405 public boolean isNavigable()
406 {
407 return this.getSuperAssociationEndFacade().isNavigable();
408 }
409
410 /**
411 * True if this association end's multiplicity is one while the other end's is many.
412 * @see AssociationEndFacade#isOne2Many()
413 */
414 public boolean isOne2Many()
415 {
416 return this.getSuperAssociationEndFacade().isOne2Many();
417 }
418
419 /**
420 * True if this association end's and the other end's multiplicities are both one.
421 * @see AssociationEndFacade#isOne2One()
422 */
423 public boolean isOne2One()
424 {
425 return this.getSuperAssociationEndFacade().isOne2One();
426 }
427
428 /**
429 * Indicates whether or not the association ends are ordered (if multiplicity is greater than
430 * 1).
431 * @see AssociationEndFacade#isOrdered()
432 */
433 public boolean isOrdered()
434 {
435 return this.getSuperAssociationEndFacade().isOrdered();
436 }
437
438 /**
439 * True if the association end cannot be changed.
440 * @see AssociationEndFacade#isReadOnly()
441 */
442 public boolean isReadOnly()
443 {
444 return this.getSuperAssociationEndFacade().isReadOnly();
445 }
446
447 /**
448 * True if this association end's multiplicity is strictly greater than zero.
449 * @see AssociationEndFacade#isRequired()
450 */
451 public boolean isRequired()
452 {
453 return this.getSuperAssociationEndFacade().isRequired();
454 }
455
456 /**
457 * Indicates if this associationEnd is 'static', meaning it has a classifier scope.
458 * @see AssociationEndFacade#isStatic()
459 */
460 public boolean isStatic()
461 {
462 return this.getSuperAssociationEndFacade().isStatic();
463 }
464
465 /**
466 * UML2: If the association attribute is unique within the Collection type. UML14 always returns
467 * false. Unique+Ordered determines the implementation Collection type. Default=false.
468 * @see AssociationEndFacade#isUnique()
469 */
470 public boolean isUnique()
471 {
472 return this.getSuperAssociationEndFacade().isUnique();
473 }
474
475 /**
476 * Copies all tagged values from the given ModelElementFacade to this model element facade.
477 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
478 */
479 public void copyTaggedValues(ModelElementFacade element)
480 {
481 this.getSuperAssociationEndFacade().copyTaggedValues(element);
482 }
483
484 /**
485 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
486 * one found will be returned.
487 * @see ModelElementFacade#findTaggedValue(String tagName)
488 */
489 public Object findTaggedValue(String tagName)
490 {
491 return this.getSuperAssociationEndFacade().findTaggedValue(tagName);
492 }
493
494 /**
495 * Returns all the values for the tagged value with the specified name. The returned collection
496 * will contains only String instances, or will be empty. Never null.
497 * @see ModelElementFacade#findTaggedValues(String tagName)
498 */
499 public Collection<Object> findTaggedValues(String tagName)
500 {
501 return this.getSuperAssociationEndFacade().findTaggedValues(tagName);
502 }
503
504 /**
505 * Returns the fully qualified name of the model element. The fully qualified name includes
506 * complete package qualified name of the underlying model element. The templates parameter will
507 * be replaced by the correct one given the binding relation of the parameter to this element.
508 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
509 */
510 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
511 {
512 return this.getSuperAssociationEndFacade().getBindedFullyQualifiedName(bindedElement);
513 }
514
515 /**
516 * Gets all constraints belonging to the model element.
517 * @see ModelElementFacade#getConstraints()
518 */
519 public Collection<ConstraintFacade> getConstraints()
520 {
521 return this.getSuperAssociationEndFacade().getConstraints();
522 }
523
524 /**
525 * Returns the constraints of the argument kind that have been placed onto this model. Typical
526 * kinds are "inv", "pre" and "post". Other kinds are possible.
527 * @see ModelElementFacade#getConstraints(String kind)
528 */
529 public Collection<ConstraintFacade> getConstraints(String kind)
530 {
531 return this.getSuperAssociationEndFacade().getConstraints(kind);
532 }
533
534 /**
535 * Gets the documentation for the model element, The indent argument is prefixed to each line.
536 * By default this method wraps lines after 64 characters.
537 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
538 * @see ModelElementFacade#getDocumentation(String indent)
539 */
540 public String getDocumentation(String indent)
541 {
542 return this.getSuperAssociationEndFacade().getDocumentation(indent);
543 }
544
545 /**
546 * This method returns the documentation for this model element, with the lines wrapped after
547 * the specified number of characters, values of less than 1 will indicate no line wrapping is
548 * required. By default paragraphs are returned as HTML.
549 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
550 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
551 */
552 public String getDocumentation(String indent, int lineLength)
553 {
554 return this.getSuperAssociationEndFacade().getDocumentation(indent, lineLength);
555 }
556
557 /**
558 * This method returns the documentation for this model element, with the lines wrapped after
559 * the specified number of characters, values of less than 1 will indicate no line wrapping is
560 * required. HTML style determines if HTML Escaping is applied.
561 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
562 */
563 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
564 {
565 return this.getSuperAssociationEndFacade().getDocumentation(indent, lineLength, htmlStyle);
566 }
567
568 /**
569 * The fully qualified name of this model element.
570 * @see ModelElementFacade#getFullyQualifiedName()
571 */
572 public String getFullyQualifiedName()
573 {
574 return this.getSuperAssociationEndFacade().getFullyQualifiedName();
575 }
576
577 /**
578 * Returns the fully qualified name of the model element. The fully qualified name includes
579 * complete package qualified name of the underlying model element. If modelName is true, then
580 * the original name of the model element (the name contained within the model) will be the name
581 * returned, otherwise a name from a language mapping will be returned.
582 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
583 */
584 public String getFullyQualifiedName(boolean modelName)
585 {
586 return this.getSuperAssociationEndFacade().getFullyQualifiedName(modelName);
587 }
588
589 /**
590 * Returns the fully qualified name as a path, the returned value always starts with out a slash
591 * '/'.
592 * @see ModelElementFacade#getFullyQualifiedNamePath()
593 */
594 public String getFullyQualifiedNamePath()
595 {
596 return this.getSuperAssociationEndFacade().getFullyQualifiedNamePath();
597 }
598
599 /**
600 * Gets the unique identifier of the underlying model element.
601 * @see ModelElementFacade#getId()
602 */
603 public String getId()
604 {
605 return this.getSuperAssociationEndFacade().getId();
606 }
607
608 /**
609 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
610 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
611 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
612 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
613 * JDK5 compiler level.
614 * @see ModelElementFacade#getKeywords()
615 */
616 public Collection<String> getKeywords()
617 {
618 return this.getSuperAssociationEndFacade().getKeywords();
619 }
620
621 /**
622 * UML2: Retrieves a localized label for this named element.
623 * @see ModelElementFacade#getLabel()
624 */
625 public String getLabel()
626 {
627 return this.getSuperAssociationEndFacade().getLabel();
628 }
629
630 /**
631 * The language mappings that have been set for this model element.
632 * @see ModelElementFacade#getLanguageMappings()
633 */
634 public TypeMappings getLanguageMappings()
635 {
636 return this.getSuperAssociationEndFacade().getLanguageMappings();
637 }
638
639 /**
640 * Return the model containing this model element (multiple models may be loaded and processed
641 * at the same time).
642 * @see ModelElementFacade#getModel()
643 */
644 public ModelFacade getModel()
645 {
646 return this.getSuperAssociationEndFacade().getModel();
647 }
648
649 /**
650 * The name of the model element.
651 * @see ModelElementFacade#getName()
652 */
653 public String getName()
654 {
655 return this.getSuperAssociationEndFacade().getName();
656 }
657
658 /**
659 * Gets the package to which this model element belongs.
660 * @see ModelElementFacade#getPackage()
661 */
662 public ModelElementFacade getPackage()
663 {
664 return this.getSuperAssociationEndFacade().getPackage();
665 }
666
667 /**
668 * The name of this model element's package.
669 * @see ModelElementFacade#getPackageName()
670 */
671 public String getPackageName()
672 {
673 return this.getSuperAssociationEndFacade().getPackageName();
674 }
675
676 /**
677 * Gets the package name (optionally providing the ability to retrieve the model name and not
678 * the mapped name).
679 * @see ModelElementFacade#getPackageName(boolean modelName)
680 */
681 public String getPackageName(boolean modelName)
682 {
683 return this.getSuperAssociationEndFacade().getPackageName(modelName);
684 }
685
686 /**
687 * Returns the package as a path, the returned value always starts with out a slash '/'.
688 * @see ModelElementFacade#getPackagePath()
689 */
690 public String getPackagePath()
691 {
692 return this.getSuperAssociationEndFacade().getPackagePath();
693 }
694
695 /**
696 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
697 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
698 * the names of the containing namespaces starting at the root of the hierarchy and ending with
699 * the name of the NamedElement itself.
700 * @see ModelElementFacade#getQualifiedName()
701 */
702 public String getQualifiedName()
703 {
704 return this.getSuperAssociationEndFacade().getQualifiedName();
705 }
706
707 /**
708 * Gets the root package for the model element.
709 * @see ModelElementFacade#getRootPackage()
710 */
711 public PackageFacade getRootPackage()
712 {
713 return this.getSuperAssociationEndFacade().getRootPackage();
714 }
715
716 /**
717 * Gets the dependencies for which this model element is the source.
718 * @see ModelElementFacade#getSourceDependencies()
719 */
720 public Collection<DependencyFacade> getSourceDependencies()
721 {
722 return this.getSuperAssociationEndFacade().getSourceDependencies();
723 }
724
725 /**
726 * If this model element is the context of an activity graph, this represents that activity
727 * graph.
728 * @see ModelElementFacade#getStateMachineContext()
729 */
730 public StateMachineFacade getStateMachineContext()
731 {
732 return this.getSuperAssociationEndFacade().getStateMachineContext();
733 }
734
735 /**
736 * The collection of ALL stereotype names for this model element.
737 * @see ModelElementFacade#getStereotypeNames()
738 */
739 public Collection<String> getStereotypeNames()
740 {
741 return this.getSuperAssociationEndFacade().getStereotypeNames();
742 }
743
744 /**
745 * Gets all stereotypes for this model element.
746 * @see ModelElementFacade#getStereotypes()
747 */
748 public Collection<StereotypeFacade> getStereotypes()
749 {
750 return this.getSuperAssociationEndFacade().getStereotypes();
751 }
752
753 /**
754 * Return the TaggedValues associated with this model element, under all stereotypes.
755 * @see ModelElementFacade#getTaggedValues()
756 */
757 public Collection<TaggedValueFacade> getTaggedValues()
758 {
759 return this.getSuperAssociationEndFacade().getTaggedValues();
760 }
761
762 /**
763 * Gets the dependencies for which this model element is the target.
764 * @see ModelElementFacade#getTargetDependencies()
765 */
766 public Collection<DependencyFacade> getTargetDependencies()
767 {
768 return this.getSuperAssociationEndFacade().getTargetDependencies();
769 }
770
771 /**
772 * Get the template parameter for this model element having the parameterName
773 * @see ModelElementFacade#getTemplateParameter(String parameterName)
774 */
775 public Object getTemplateParameter(String parameterName)
776 {
777 return this.getSuperAssociationEndFacade().getTemplateParameter(parameterName);
778 }
779
780 /**
781 * Get the template parameters for this model element
782 * @see ModelElementFacade#getTemplateParameters()
783 */
784 public Collection<TemplateParameterFacade> getTemplateParameters()
785 {
786 return this.getSuperAssociationEndFacade().getTemplateParameters();
787 }
788
789 /**
790 * The visibility (i.e. public, private, protected or package) of the model element, will
791 * attempt a lookup for these values in the language mappings (if any).
792 * @see ModelElementFacade#getVisibility()
793 */
794 public String getVisibility()
795 {
796 return this.getSuperAssociationEndFacade().getVisibility();
797 }
798
799 /**
800 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
801 * is taken into account when searching for the stereotype), false otherwise.
802 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
803 */
804 public boolean hasExactStereotype(String stereotypeName)
805 {
806 return this.getSuperAssociationEndFacade().hasExactStereotype(stereotypeName);
807 }
808
809 /**
810 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
811 * pipe, semicolon, or << >>
812 * @see ModelElementFacade#hasKeyword(String keywordName)
813 */
814 public boolean hasKeyword(String keywordName)
815 {
816 return this.getSuperAssociationEndFacade().hasKeyword(keywordName);
817 }
818
819 /**
820 * Returns true if the model element has the specified stereotype. If the stereotype itself
821 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
822 * one of the stereotype's ancestors has a matching name this method will return true, false
823 * otherwise.
824 * For example, if we have a certain stereotype called <<exception>> and a model element has a
825 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
826 * method with 'stereotypeName' defined as 'exception' the method would return true since
827 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
828 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
829 * @see ModelElementFacade#hasStereotype(String stereotypeName)
830 */
831 public boolean hasStereotype(String stereotypeName)
832 {
833 return this.getSuperAssociationEndFacade().hasStereotype(stereotypeName);
834 }
835
836 /**
837 * True if there are target dependencies from this element that are instances of BindingFacade.
838 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
839 * @see ModelElementFacade#isBindingDependenciesPresent()
840 */
841 public boolean isBindingDependenciesPresent()
842 {
843 return this.getSuperAssociationEndFacade().isBindingDependenciesPresent();
844 }
845
846 /**
847 * Indicates if any constraints are present on this model element.
848 * @see ModelElementFacade#isConstraintsPresent()
849 */
850 public boolean isConstraintsPresent()
851 {
852 return this.getSuperAssociationEndFacade().isConstraintsPresent();
853 }
854
855 /**
856 * Indicates if any documentation is present on this model element.
857 * @see ModelElementFacade#isDocumentationPresent()
858 */
859 public boolean isDocumentationPresent()
860 {
861 return this.getSuperAssociationEndFacade().isDocumentationPresent();
862 }
863
864 /**
865 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
866 * @see ModelElementFacade#isReservedWord()
867 */
868 public boolean isReservedWord()
869 {
870 return this.getSuperAssociationEndFacade().isReservedWord();
871 }
872
873 /**
874 * True is there are template parameters on this model element. For UML2, applies to Class,
875 * Operation, Property, and Parameter.
876 * @see ModelElementFacade#isTemplateParametersPresent()
877 */
878 public boolean isTemplateParametersPresent()
879 {
880 return this.getSuperAssociationEndFacade().isTemplateParametersPresent();
881 }
882
883 /**
884 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
885 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
886 * Enumerations and Interfaces, optionally applies on other model elements.
887 * @see ModelElementFacade#isValidIdentifierName()
888 */
889 public boolean isValidIdentifierName()
890 {
891 return this.getSuperAssociationEndFacade().isValidIdentifierName();
892 }
893
894 /**
895 * Searches for the constraint with the specified 'name' on this model element, and if found
896 * translates it using the specified 'translation' from a translation library discovered by the
897 * framework.
898 * @see ModelElementFacade#translateConstraint(String name, String translation)
899 */
900 public String translateConstraint(String name, String translation)
901 {
902 return this.getSuperAssociationEndFacade().translateConstraint(name, translation);
903 }
904
905 /**
906 * Translates all constraints belonging to this model element with the given 'translation'.
907 * @see ModelElementFacade#translateConstraints(String translation)
908 */
909 public String[] translateConstraints(String translation)
910 {
911 return this.getSuperAssociationEndFacade().translateConstraints(translation);
912 }
913
914 /**
915 * Translates the constraints of the specified 'kind' belonging to this model element.
916 * @see ModelElementFacade#translateConstraints(String kind, String translation)
917 */
918 public String[] translateConstraints(String kind, String translation)
919 {
920 return this.getSuperAssociationEndFacade().translateConstraints(kind, translation);
921 }
922
923 /**
924 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
925 */
926 @Override
927 public void initialize()
928 {
929 this.getSuperAssociationEndFacade().initialize();
930 }
931
932 /**
933 * @return Object getSuperAssociationEndFacade().getValidationOwner()
934 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
935 */
936 @Override
937 public Object getValidationOwner()
938 {
939 Object owner = this.getSuperAssociationEndFacade().getValidationOwner();
940 return owner;
941 }
942
943 /**
944 * @return String getSuperAssociationEndFacade().getValidationName()
945 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
946 */
947 @Override
948 public String getValidationName()
949 {
950 String name = this.getSuperAssociationEndFacade().getValidationName();
951 return name;
952 }
953
954 /**
955 * @param validationMessages Collection<ModelValidationMessage>
956 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
957 */
958 @Override
959 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
960 {
961 this.getSuperAssociationEndFacade().validateInvariants(validationMessages);
962 }
963
964 /**
965 * The property that stores the name of the metafacade.
966 */
967 private static final String NAME_PROPERTY = "name";
968 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
969
970 /**
971 * @see Object#toString()
972 */
973 @Override
974 public String toString()
975 {
976 final StringBuilder toString = new StringBuilder(this.getClass().getName());
977 toString.append("[");
978 try
979 {
980 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
981 }
982 catch (final Throwable tryAgain)
983 {
984 try
985 {
986 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
987 }
988 catch (final Throwable ignore)
989 {
990 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
991 }
992 }
993 toString.append("]");
994 return toString.toString();
995 }
996 }