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