1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.spring.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.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.andromda.metafacades.uml.ModelFacade;
17 import org.andromda.metafacades.uml.OperationFacade;
18 import org.andromda.metafacades.uml.PackageFacade;
19 import org.andromda.metafacades.uml.ParameterFacade;
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 * TODO: Model Documentation for org.andromda.cartridges.spring.metafacades.SpringEntityOperation
28 * MetafacadeLogic for SpringEntityOperation
29 *
30 * @see SpringEntityOperation
31 */
32 public abstract class SpringEntityOperationLogic
33 extends MetafacadeBase
34 implements SpringEntityOperation
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 SpringEntityOperationLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superOperationFacade =
50 (OperationFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.OperationFacade",
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 SpringEntityOperation 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.spring.metafacades.SpringEntityOperation";
68 }
69 return context;
70 }
71
72 private OperationFacade superOperationFacade;
73 private boolean superOperationFacadeInitialized = false;
74
75 /**
76 * Gets the OperationFacade parent instance.
77 * @return this.superOperationFacade OperationFacade
78 */
79 private OperationFacade getSuperOperationFacade()
80 {
81 if (!this.superOperationFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superOperationFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superOperationFacadeInitialized = true;
85 }
86 return this.superOperationFacade;
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.superOperationFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superOperationFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107 /**
108 * @return boolean true always
109 * @see SpringEntityOperation
110 */
111 public boolean isSpringEntityOperationMetaType()
112 {
113 return true;
114 }
115
116 // --------------- attributes ---------------------
117
118 /**
119 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationName()
120 * @return String
121 */
122 protected abstract String handleGetImplementationName();
123
124 private String __implementationName1a;
125 private boolean __implementationName1aSet = false;
126
127 /**
128 * The name of the operation used within the entity implementation.
129 * @return (String)handleGetImplementationName()
130 */
131 public final String getImplementationName()
132 {
133 String implementationName1a = this.__implementationName1a;
134 if (!this.__implementationName1aSet)
135 {
136 // implementationName has no pre constraints
137 implementationName1a = handleGetImplementationName();
138 // implementationName has no post constraints
139 this.__implementationName1a = implementationName1a;
140 if (isMetafacadePropertyCachingEnabled())
141 {
142 this.__implementationName1aSet = true;
143 }
144 }
145 return implementationName1a;
146 }
147
148 /**
149 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationCall()
150 * @return String
151 */
152 protected abstract String handleGetImplementationCall();
153
154 private String __implementationCall2a;
155 private boolean __implementationCall2aSet = false;
156
157 /**
158 * The method call for the implementation operation.
159 * @return (String)handleGetImplementationCall()
160 */
161 public final String getImplementationCall()
162 {
163 String implementationCall2a = this.__implementationCall2a;
164 if (!this.__implementationCall2aSet)
165 {
166 // implementationCall has no pre constraints
167 implementationCall2a = handleGetImplementationCall();
168 // implementationCall has no post constraints
169 this.__implementationCall2a = implementationCall2a;
170 if (isMetafacadePropertyCachingEnabled())
171 {
172 this.__implementationCall2aSet = true;
173 }
174 }
175 return implementationCall2a;
176 }
177
178 /**
179 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationSignature()
180 * @return String
181 */
182 protected abstract String handleGetImplementationSignature();
183
184 private String __implementationSignature3a;
185 private boolean __implementationSignature3aSet = false;
186
187 /**
188 * The signature for the implementation operation.
189 * @return (String)handleGetImplementationSignature()
190 */
191 public final String getImplementationSignature()
192 {
193 String implementationSignature3a = this.__implementationSignature3a;
194 if (!this.__implementationSignature3aSet)
195 {
196 // implementationSignature has no pre constraints
197 implementationSignature3a = handleGetImplementationSignature();
198 // implementationSignature has no post constraints
199 this.__implementationSignature3a = implementationSignature3a;
200 if (isMetafacadePropertyCachingEnabled())
201 {
202 this.__implementationSignature3aSet = true;
203 }
204 }
205 return implementationSignature3a;
206 }
207
208 /**
209 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPrePersist()
210 * @return boolean
211 */
212 protected abstract boolean handleIsPrePersist();
213
214 private boolean __prePersist4a;
215 private boolean __prePersist4aSet = false;
216
217 /**
218 * Returns true if the associated operation has the <<PrePersist>> stereotype.
219 * NOTE: The method signature must return void and have one arg with the same type of the
220 * entity.
221 * @return (boolean)handleIsPrePersist()
222 */
223 public final boolean isPrePersist()
224 {
225 boolean prePersist4a = this.__prePersist4a;
226 if (!this.__prePersist4aSet)
227 {
228 // prePersist has no pre constraints
229 prePersist4a = handleIsPrePersist();
230 // prePersist has no post constraints
231 this.__prePersist4a = prePersist4a;
232 if (isMetafacadePropertyCachingEnabled())
233 {
234 this.__prePersist4aSet = true;
235 }
236 }
237 return prePersist4a;
238 }
239
240 /**
241 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPostPersist()
242 * @return boolean
243 */
244 protected abstract boolean handleIsPostPersist();
245
246 private boolean __postPersist5a;
247 private boolean __postPersist5aSet = false;
248
249 /**
250 * Returns true if the associated operation has the <<PostPersist>> stereotype.
251 * NOTE: The method signature must return void and have one arg with the same type of the entity
252 * @return (boolean)handleIsPostPersist()
253 */
254 public final boolean isPostPersist()
255 {
256 boolean postPersist5a = this.__postPersist5a;
257 if (!this.__postPersist5aSet)
258 {
259 // postPersist has no pre constraints
260 postPersist5a = handleIsPostPersist();
261 // postPersist has no post constraints
262 this.__postPersist5a = postPersist5a;
263 if (isMetafacadePropertyCachingEnabled())
264 {
265 this.__postPersist5aSet = true;
266 }
267 }
268 return postPersist5a;
269 }
270
271 /**
272 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPreRemove()
273 * @return boolean
274 */
275 protected abstract boolean handleIsPreRemove();
276
277 private boolean __preRemove6a;
278 private boolean __preRemove6aSet = false;
279
280 /**
281 * Returns true if the associated operation has the <<PreRemove>> stereotype.
282 * NOTE: The method signature must return void and have one arg with the same type of the entity
283 * @return (boolean)handleIsPreRemove()
284 */
285 public final boolean isPreRemove()
286 {
287 boolean preRemove6a = this.__preRemove6a;
288 if (!this.__preRemove6aSet)
289 {
290 // preRemove has no pre constraints
291 preRemove6a = handleIsPreRemove();
292 // preRemove has no post constraints
293 this.__preRemove6a = preRemove6a;
294 if (isMetafacadePropertyCachingEnabled())
295 {
296 this.__preRemove6aSet = true;
297 }
298 }
299 return preRemove6a;
300 }
301
302 /**
303 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPostRemove()
304 * @return boolean
305 */
306 protected abstract boolean handleIsPostRemove();
307
308 private boolean __postRemove7a;
309 private boolean __postRemove7aSet = false;
310
311 /**
312 * Returns true if the associated operation has the <<PostRemove>> stereotype.
313 * NOTE: The method signature must return void and have one arg with the same type of the entity
314 * @return (boolean)handleIsPostRemove()
315 */
316 public final boolean isPostRemove()
317 {
318 boolean postRemove7a = this.__postRemove7a;
319 if (!this.__postRemove7aSet)
320 {
321 // postRemove has no pre constraints
322 postRemove7a = handleIsPostRemove();
323 // postRemove has no post constraints
324 this.__postRemove7a = postRemove7a;
325 if (isMetafacadePropertyCachingEnabled())
326 {
327 this.__postRemove7aSet = true;
328 }
329 }
330 return postRemove7a;
331 }
332
333 /**
334 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPreUpdate()
335 * @return boolean
336 */
337 protected abstract boolean handleIsPreUpdate();
338
339 private boolean __preUpdate8a;
340 private boolean __preUpdate8aSet = false;
341
342 /**
343 * Returns true if the associated operation has the <<PreUpdate>> stereotype.
344 * NOTE: The method signature must return void and have one arg with the same type of the entity
345 * @return (boolean)handleIsPreUpdate()
346 */
347 public final boolean isPreUpdate()
348 {
349 boolean preUpdate8a = this.__preUpdate8a;
350 if (!this.__preUpdate8aSet)
351 {
352 // preUpdate has no pre constraints
353 preUpdate8a = handleIsPreUpdate();
354 // preUpdate has no post constraints
355 this.__preUpdate8a = preUpdate8a;
356 if (isMetafacadePropertyCachingEnabled())
357 {
358 this.__preUpdate8aSet = true;
359 }
360 }
361 return preUpdate8a;
362 }
363
364 /**
365 * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#isPostUpdate()
366 * @return boolean
367 */
368 protected abstract boolean handleIsPostUpdate();
369
370 private boolean __postUpdate9a;
371 private boolean __postUpdate9aSet = false;
372
373 /**
374 * Returns true if the associated operation has the <<PostUpdate>> stereotype.
375 * NOTE: The method signature must return void and have one arg with the same type of the entity
376 * @return (boolean)handleIsPostUpdate()
377 */
378 public final boolean isPostUpdate()
379 {
380 boolean postUpdate9a = this.__postUpdate9a;
381 if (!this.__postUpdate9aSet)
382 {
383 // postUpdate has no pre constraints
384 postUpdate9a = handleIsPostUpdate();
385 // postUpdate has no post constraints
386 this.__postUpdate9a = postUpdate9a;
387 if (isMetafacadePropertyCachingEnabled())
388 {
389 this.__postUpdate9aSet = true;
390 }
391 }
392 return postUpdate9a;
393 }
394
395 // ------------- associations ------------------
396
397 /**
398 * @return true
399 * @see OperationFacade
400 */
401 public boolean isOperationFacadeMetaType()
402 {
403 return true;
404 }
405
406 /**
407 * @return true
408 * @see ModelElementFacade
409 */
410 public boolean isModelElementFacadeMetaType()
411 {
412 return true;
413 }
414
415 // ----------- delegates to OperationFacade ------------
416 /**
417 * Copies all tagged values from the given ModelElementFacade to this model element facade.
418 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
419 */
420 public void copyTaggedValues(ModelElementFacade element)
421 {
422 this.getSuperOperationFacade().copyTaggedValues(element);
423 }
424
425 /**
426 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
427 * one found will be returned.
428 * @see ModelElementFacade#findTaggedValue(String tagName)
429 */
430 public Object findTaggedValue(String tagName)
431 {
432 return this.getSuperOperationFacade().findTaggedValue(tagName);
433 }
434
435 /**
436 * Returns all the values for the tagged value with the specified name. The returned collection
437 * will contains only String instances, or will be empty. Never null.
438 * @see ModelElementFacade#findTaggedValues(String tagName)
439 */
440 public Collection<Object> findTaggedValues(String tagName)
441 {
442 return this.getSuperOperationFacade().findTaggedValues(tagName);
443 }
444
445 /**
446 * Returns the fully qualified name of the model element. The fully qualified name includes
447 * complete package qualified name of the underlying model element. The templates parameter will
448 * be replaced by the correct one given the binding relation of the parameter to this element.
449 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
450 */
451 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
452 {
453 return this.getSuperOperationFacade().getBindedFullyQualifiedName(bindedElement);
454 }
455
456 /**
457 * Gets all constraints belonging to the model element.
458 * @see ModelElementFacade#getConstraints()
459 */
460 public Collection<ConstraintFacade> getConstraints()
461 {
462 return this.getSuperOperationFacade().getConstraints();
463 }
464
465 /**
466 * Returns the constraints of the argument kind that have been placed onto this model. Typical
467 * kinds are "inv", "pre" and "post". Other kinds are possible.
468 * @see ModelElementFacade#getConstraints(String kind)
469 */
470 public Collection<ConstraintFacade> getConstraints(String kind)
471 {
472 return this.getSuperOperationFacade().getConstraints(kind);
473 }
474
475 /**
476 * Gets the documentation for the model element, The indent argument is prefixed to each line.
477 * By default this method wraps lines after 64 characters.
478 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
479 * @see ModelElementFacade#getDocumentation(String indent)
480 */
481 public String getDocumentation(String indent)
482 {
483 return this.getSuperOperationFacade().getDocumentation(indent);
484 }
485
486 /**
487 * This method returns the documentation for this model element, with the lines wrapped after
488 * the specified number of characters, values of less than 1 will indicate no line wrapping is
489 * required. By default paragraphs are returned as HTML.
490 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
491 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
492 */
493 public String getDocumentation(String indent, int lineLength)
494 {
495 return this.getSuperOperationFacade().getDocumentation(indent, lineLength);
496 }
497
498 /**
499 * This method returns the documentation for this model element, with the lines wrapped after
500 * the specified number of characters, values of less than 1 will indicate no line wrapping is
501 * required. HTML style determines if HTML Escaping is applied.
502 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
503 */
504 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
505 {
506 return this.getSuperOperationFacade().getDocumentation(indent, lineLength, htmlStyle);
507 }
508
509 /**
510 * The fully qualified name of this model element.
511 * @see ModelElementFacade#getFullyQualifiedName()
512 */
513 public String getFullyQualifiedName()
514 {
515 return this.getSuperOperationFacade().getFullyQualifiedName();
516 }
517
518 /**
519 * Returns the fully qualified name of the model element. The fully qualified name includes
520 * complete package qualified name of the underlying model element. If modelName is true, then
521 * the original name of the model element (the name contained within the model) will be the name
522 * returned, otherwise a name from a language mapping will be returned.
523 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
524 */
525 public String getFullyQualifiedName(boolean modelName)
526 {
527 return this.getSuperOperationFacade().getFullyQualifiedName(modelName);
528 }
529
530 /**
531 * Returns the fully qualified name as a path, the returned value always starts with out a slash
532 * '/'.
533 * @see ModelElementFacade#getFullyQualifiedNamePath()
534 */
535 public String getFullyQualifiedNamePath()
536 {
537 return this.getSuperOperationFacade().getFullyQualifiedNamePath();
538 }
539
540 /**
541 * Gets the unique identifier of the underlying model element.
542 * @see ModelElementFacade#getId()
543 */
544 public String getId()
545 {
546 return this.getSuperOperationFacade().getId();
547 }
548
549 /**
550 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
551 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
552 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
553 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
554 * JDK5 compiler level.
555 * @see ModelElementFacade#getKeywords()
556 */
557 public Collection<String> getKeywords()
558 {
559 return this.getSuperOperationFacade().getKeywords();
560 }
561
562 /**
563 * UML2: Retrieves a localized label for this named element.
564 * @see ModelElementFacade#getLabel()
565 */
566 public String getLabel()
567 {
568 return this.getSuperOperationFacade().getLabel();
569 }
570
571 /**
572 * The language mappings that have been set for this model element.
573 * @see ModelElementFacade#getLanguageMappings()
574 */
575 public TypeMappings getLanguageMappings()
576 {
577 return this.getSuperOperationFacade().getLanguageMappings();
578 }
579
580 /**
581 * Return the model containing this model element (multiple models may be loaded and processed
582 * at the same time).
583 * @see ModelElementFacade#getModel()
584 */
585 public ModelFacade getModel()
586 {
587 return this.getSuperOperationFacade().getModel();
588 }
589
590 /**
591 * The name of the model element.
592 * @see ModelElementFacade#getName()
593 */
594 public String getName()
595 {
596 return this.getSuperOperationFacade().getName();
597 }
598
599 /**
600 * Gets the package to which this model element belongs.
601 * @see ModelElementFacade#getPackage()
602 */
603 public ModelElementFacade getPackage()
604 {
605 return this.getSuperOperationFacade().getPackage();
606 }
607
608 /**
609 * The name of this model element's package.
610 * @see ModelElementFacade#getPackageName()
611 */
612 public String getPackageName()
613 {
614 return this.getSuperOperationFacade().getPackageName();
615 }
616
617 /**
618 * Gets the package name (optionally providing the ability to retrieve the model name and not
619 * the mapped name).
620 * @see ModelElementFacade#getPackageName(boolean modelName)
621 */
622 public String getPackageName(boolean modelName)
623 {
624 return this.getSuperOperationFacade().getPackageName(modelName);
625 }
626
627 /**
628 * Returns the package as a path, the returned value always starts with out a slash '/'.
629 * @see ModelElementFacade#getPackagePath()
630 */
631 public String getPackagePath()
632 {
633 return this.getSuperOperationFacade().getPackagePath();
634 }
635
636 /**
637 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
638 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
639 * the names of the containing namespaces starting at the root of the hierarchy and ending with
640 * the name of the NamedElement itself.
641 * @see ModelElementFacade#getQualifiedName()
642 */
643 public String getQualifiedName()
644 {
645 return this.getSuperOperationFacade().getQualifiedName();
646 }
647
648 /**
649 * Gets the root package for the model element.
650 * @see ModelElementFacade#getRootPackage()
651 */
652 public PackageFacade getRootPackage()
653 {
654 return this.getSuperOperationFacade().getRootPackage();
655 }
656
657 /**
658 * Gets the dependencies for which this model element is the source.
659 * @see ModelElementFacade#getSourceDependencies()
660 */
661 public Collection<DependencyFacade> getSourceDependencies()
662 {
663 return this.getSuperOperationFacade().getSourceDependencies();
664 }
665
666 /**
667 * If this model element is the context of an activity graph, this represents that activity
668 * graph.
669 * @see ModelElementFacade#getStateMachineContext()
670 */
671 public StateMachineFacade getStateMachineContext()
672 {
673 return this.getSuperOperationFacade().getStateMachineContext();
674 }
675
676 /**
677 * The collection of ALL stereotype names for this model element.
678 * @see ModelElementFacade#getStereotypeNames()
679 */
680 public Collection<String> getStereotypeNames()
681 {
682 return this.getSuperOperationFacade().getStereotypeNames();
683 }
684
685 /**
686 * Gets all stereotypes for this model element.
687 * @see ModelElementFacade#getStereotypes()
688 */
689 public Collection<StereotypeFacade> getStereotypes()
690 {
691 return this.getSuperOperationFacade().getStereotypes();
692 }
693
694 /**
695 * Return the TaggedValues associated with this model element, under all stereotypes.
696 * @see ModelElementFacade#getTaggedValues()
697 */
698 public Collection<TaggedValueFacade> getTaggedValues()
699 {
700 return this.getSuperOperationFacade().getTaggedValues();
701 }
702
703 /**
704 * Gets the dependencies for which this model element is the target.
705 * @see ModelElementFacade#getTargetDependencies()
706 */
707 public Collection<DependencyFacade> getTargetDependencies()
708 {
709 return this.getSuperOperationFacade().getTargetDependencies();
710 }
711
712 /**
713 * Get the template parameter for this model element having the parameterName
714 * @see ModelElementFacade#getTemplateParameter(String parameterName)
715 */
716 public Object getTemplateParameter(String parameterName)
717 {
718 return this.getSuperOperationFacade().getTemplateParameter(parameterName);
719 }
720
721 /**
722 * Get the template parameters for this model element
723 * @see ModelElementFacade#getTemplateParameters()
724 */
725 public Collection<TemplateParameterFacade> getTemplateParameters()
726 {
727 return this.getSuperOperationFacade().getTemplateParameters();
728 }
729
730 /**
731 * The visibility (i.e. public, private, protected or package) of the model element, will
732 * attempt a lookup for these values in the language mappings (if any).
733 * @see ModelElementFacade#getVisibility()
734 */
735 public String getVisibility()
736 {
737 return this.getSuperOperationFacade().getVisibility();
738 }
739
740 /**
741 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
742 * is taken into account when searching for the stereotype), false otherwise.
743 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
744 */
745 public boolean hasExactStereotype(String stereotypeName)
746 {
747 return this.getSuperOperationFacade().hasExactStereotype(stereotypeName);
748 }
749
750 /**
751 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
752 * pipe, semicolon, or << >>
753 * @see ModelElementFacade#hasKeyword(String keywordName)
754 */
755 public boolean hasKeyword(String keywordName)
756 {
757 return this.getSuperOperationFacade().hasKeyword(keywordName);
758 }
759
760 /**
761 * Returns true if the model element has the specified stereotype. If the stereotype itself
762 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
763 * one of the stereotype's ancestors has a matching name this method will return true, false
764 * otherwise.
765 * For example, if we have a certain stereotype called <<exception>> and a model element has a
766 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
767 * method with 'stereotypeName' defined as 'exception' the method would return true since
768 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
769 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
770 * @see ModelElementFacade#hasStereotype(String stereotypeName)
771 */
772 public boolean hasStereotype(String stereotypeName)
773 {
774 return this.getSuperOperationFacade().hasStereotype(stereotypeName);
775 }
776
777 /**
778 * True if there are target dependencies from this element that are instances of BindingFacade.
779 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
780 * @see ModelElementFacade#isBindingDependenciesPresent()
781 */
782 public boolean isBindingDependenciesPresent()
783 {
784 return this.getSuperOperationFacade().isBindingDependenciesPresent();
785 }
786
787 /**
788 * Indicates if any constraints are present on this model element.
789 * @see ModelElementFacade#isConstraintsPresent()
790 */
791 public boolean isConstraintsPresent()
792 {
793 return this.getSuperOperationFacade().isConstraintsPresent();
794 }
795
796 /**
797 * Indicates if any documentation is present on this model element.
798 * @see ModelElementFacade#isDocumentationPresent()
799 */
800 public boolean isDocumentationPresent()
801 {
802 return this.getSuperOperationFacade().isDocumentationPresent();
803 }
804
805 /**
806 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
807 * @see ModelElementFacade#isReservedWord()
808 */
809 public boolean isReservedWord()
810 {
811 return this.getSuperOperationFacade().isReservedWord();
812 }
813
814 /**
815 * True is there are template parameters on this model element. For UML2, applies to Class,
816 * Operation, Property, and Parameter.
817 * @see ModelElementFacade#isTemplateParametersPresent()
818 */
819 public boolean isTemplateParametersPresent()
820 {
821 return this.getSuperOperationFacade().isTemplateParametersPresent();
822 }
823
824 /**
825 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
826 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
827 * Enumerations and Interfaces, optionally applies on other model elements.
828 * @see ModelElementFacade#isValidIdentifierName()
829 */
830 public boolean isValidIdentifierName()
831 {
832 return this.getSuperOperationFacade().isValidIdentifierName();
833 }
834
835 /**
836 * Searches for the constraint with the specified 'name' on this model element, and if found
837 * translates it using the specified 'translation' from a translation library discovered by the
838 * framework.
839 * @see ModelElementFacade#translateConstraint(String name, String translation)
840 */
841 public String translateConstraint(String name, String translation)
842 {
843 return this.getSuperOperationFacade().translateConstraint(name, translation);
844 }
845
846 /**
847 * Translates all constraints belonging to this model element with the given 'translation'.
848 * @see ModelElementFacade#translateConstraints(String translation)
849 */
850 public String[] translateConstraints(String translation)
851 {
852 return this.getSuperOperationFacade().translateConstraints(translation);
853 }
854
855 /**
856 * Translates the constraints of the specified 'kind' belonging to this model element.
857 * @see ModelElementFacade#translateConstraints(String kind, String translation)
858 */
859 public String[] translateConstraints(String kind, String translation)
860 {
861 return this.getSuperOperationFacade().translateConstraints(kind, translation);
862 }
863
864 /**
865 * Finds the parameter on this operation having the given name, if no parameter is found, null
866 * is returned instead.
867 * @see OperationFacade#findParameter(String name)
868 */
869 public ParameterFacade findParameter(String name)
870 {
871 return this.getSuperOperationFacade().findParameter(name);
872 }
873
874 /**
875 * Searches the given feature for the specified tag.
876 * If the follow boolean is set to true then the search will continue from the class operation
877 * to the class itself and then up the class hierarchy.
878 * @see OperationFacade#findTaggedValue(String name, boolean follow)
879 */
880 public Object findTaggedValue(String name, boolean follow)
881 {
882 return this.getSuperOperationFacade().findTaggedValue(name, follow);
883 }
884
885 /**
886 * A comma separated list of all argument names.
887 * @see OperationFacade#getArgumentNames()
888 */
889 public String getArgumentNames()
890 {
891 return this.getSuperOperationFacade().getArgumentNames();
892 }
893
894 /**
895 * A comma separated list of all types of each argument, in order.
896 * @see OperationFacade#getArgumentTypeNames()
897 */
898 public String getArgumentTypeNames()
899 {
900 return this.getSuperOperationFacade().getArgumentTypeNames();
901 }
902
903 /**
904 * Specification of an argument used to pass information into or out of an invocation of a
905 * behavioral
906 * feature. Parameters are allowed to be treated as connectable elements. Parameters have
907 * support for
908 * streaming, exceptions, and parameter sets.
909 * @see OperationFacade#getArguments()
910 */
911 public Collection<ParameterFacade> getArguments()
912 {
913 return this.getSuperOperationFacade().getArguments();
914 }
915
916 /**
917 * Constructs the operation call with the operation name
918 * @see OperationFacade#getCall()
919 */
920 public String getCall()
921 {
922 return this.getSuperOperationFacade().getCall();
923 }
924
925 /**
926 * Returns the concurrency modifier for this operation (i.e. concurrent, guarded or sequential)
927 * of the model element, will attempt a lookup for these values in the language mappings (if
928 * any).
929 * @see OperationFacade#getConcurrency()
930 */
931 public String getConcurrency()
932 {
933 return this.getSuperOperationFacade().getConcurrency();
934 }
935
936 /**
937 * A comma separated list containing all exceptions that this operation throws. Exceptions are
938 * determined through dependencies that have the target element stereotyped as <<Exception>>.
939 * @see OperationFacade#getExceptionList()
940 */
941 public String getExceptionList()
942 {
943 return this.getSuperOperationFacade().getExceptionList();
944 }
945
946 /**
947 * Returns a comma separated list of exceptions appended to the comma separated list of fully
948 * qualified 'initialException' classes passed in to this method.
949 * @see OperationFacade#getExceptionList(String initialExceptions)
950 */
951 public String getExceptionList(String initialExceptions)
952 {
953 return this.getSuperOperationFacade().getExceptionList(initialExceptions);
954 }
955
956 /**
957 * A collection of all exceptions thrown by this operation.
958 * @see OperationFacade#getExceptions()
959 */
960 public Collection<ModelElementFacade> getExceptions()
961 {
962 return this.getSuperOperationFacade().getExceptions();
963 }
964
965 /**
966 * Return Type with multiplicity taken into account. UML14 does not allow multiplicity *.
967 * @see OperationFacade#getGetterSetterReturnTypeName()
968 */
969 public String getGetterSetterReturnTypeName()
970 {
971 return this.getSuperOperationFacade().getGetterSetterReturnTypeName();
972 }
973
974 /**
975 * the lower value for the multiplicity
976 * -only applicable for UML2
977 * @see OperationFacade#getLower()
978 */
979 public int getLower()
980 {
981 return this.getSuperOperationFacade().getLower();
982 }
983
984 /**
985 * Returns the operation method body determined from UML sequence diagrams or other UML sources.
986 * @see OperationFacade#getMethodBody()
987 */
988 public String getMethodBody()
989 {
990 return this.getSuperOperationFacade().getMethodBody();
991 }
992
993 /**
994 * The operation this operation overrides, null if this operation is not overriding.
995 * @see OperationFacade#getOverriddenOperation()
996 */
997 public OperationFacade getOverriddenOperation()
998 {
999 return this.getSuperOperationFacade().getOverriddenOperation();
1000 }
1001
1002 /**
1003 * Gets the owner of this operation
1004 * @see OperationFacade#getOwner()
1005 */
1006 public ClassifierFacade getOwner()
1007 {
1008 return this.getSuperOperationFacade().getOwner();
1009 }
1010
1011 /**
1012 * Return all parameters for the operation, including the return parameter.
1013 * @see OperationFacade#getParameters()
1014 */
1015 public Collection<ParameterFacade> getParameters()
1016 {
1017 return this.getSuperOperationFacade().getParameters();
1018 }
1019
1020 /**
1021 * The name of the operation that handles postcondition constraints.
1022 * @see OperationFacade#getPostconditionName()
1023 */
1024 public String getPostconditionName()
1025 {
1026 return this.getSuperOperationFacade().getPostconditionName();
1027 }
1028
1029 /**
1030 * The postcondition constraints belonging to this operation.
1031 * @see OperationFacade#getPostconditions()
1032 */
1033 public Collection<ConstraintFacade> getPostconditions()
1034 {
1035 return this.getSuperOperationFacade().getPostconditions();
1036 }
1037
1038 /**
1039 * The call to the precondition operation.
1040 * @see OperationFacade#getPreconditionCall()
1041 */
1042 public String getPreconditionCall()
1043 {
1044 return this.getSuperOperationFacade().getPreconditionCall();
1045 }
1046
1047 /**
1048 * The name of the operation that handles precondition constraints.
1049 * @see OperationFacade#getPreconditionName()
1050 */
1051 public String getPreconditionName()
1052 {
1053 return this.getSuperOperationFacade().getPreconditionName();
1054 }
1055
1056 /**
1057 * The signature of the precondition operation.
1058 * @see OperationFacade#getPreconditionSignature()
1059 */
1060 public String getPreconditionSignature()
1061 {
1062 return this.getSuperOperationFacade().getPreconditionSignature();
1063 }
1064
1065 /**
1066 * The precondition constraints belonging to this operation.
1067 * @see OperationFacade#getPreconditions()
1068 */
1069 public Collection<ConstraintFacade> getPreconditions()
1070 {
1071 return this.getSuperOperationFacade().getPreconditions();
1072 }
1073
1074 /**
1075 * (UML2 Only). Get the actual return parameter (which may have stereotypes etc).
1076 * @see OperationFacade#getReturnParameter()
1077 */
1078 public ParameterFacade getReturnParameter()
1079 {
1080 return this.getSuperOperationFacade().getReturnParameter();
1081 }
1082
1083 /**
1084 * The operation return type parameter.
1085 * @see OperationFacade#getReturnType()
1086 */
1087 public ClassifierFacade getReturnType()
1088 {
1089 return this.getSuperOperationFacade().getReturnType();
1090 }
1091
1092 /**
1093 * Return the operation signature, including public/protested abstract returnType name plus
1094 * argument type and name
1095 * @see OperationFacade#getSignature()
1096 */
1097 public String getSignature()
1098 {
1099 return this.getSuperOperationFacade().getSignature();
1100 }
1101
1102 /**
1103 * Returns the signature of the operation and optionally appends the argument names (if
1104 * withArgumentNames is true), otherwise returns the signature with just the types alone in the
1105 * signature.
1106 * @see OperationFacade#getSignature(boolean withArgumentNames)
1107 */
1108 public String getSignature(boolean withArgumentNames)
1109 {
1110 return this.getSuperOperationFacade().getSignature(withArgumentNames);
1111 }
1112
1113 /**
1114 * Returns the signature of the operation and optionally appends the given 'argumentModifier' to
1115 * each argument.
1116 * @see OperationFacade#getSignature(String argumentModifier)
1117 */
1118 public String getSignature(String argumentModifier)
1119 {
1120 return this.getSuperOperationFacade().getSignature(argumentModifier);
1121 }
1122
1123 /**
1124 * A comma-separated parameter list (type and name of each parameter) of an operation.
1125 * @see OperationFacade#getTypedArgumentList()
1126 */
1127 public String getTypedArgumentList()
1128 {
1129 return this.getSuperOperationFacade().getTypedArgumentList();
1130 }
1131
1132 /**
1133 * A comma-separated parameter list (type and name of each parameter) of an operation with an
1134 * optional modifier (i.e final) before each parameter.
1135 * @see OperationFacade#getTypedArgumentList(String modifier)
1136 */
1137 public String getTypedArgumentList(String modifier)
1138 {
1139 return this.getSuperOperationFacade().getTypedArgumentList(modifier);
1140 }
1141
1142 /**
1143 * the upper value for the multiplicity (will be -1 for *)
1144 * - only applicable for UML2
1145 * @see OperationFacade#getUpper()
1146 */
1147 public int getUpper()
1148 {
1149 return this.getSuperOperationFacade().getUpper();
1150 }
1151
1152 /**
1153 * True is the operation is abstract.
1154 * @see OperationFacade#isAbstract()
1155 */
1156 public boolean isAbstract()
1157 {
1158 return this.getSuperOperationFacade().isAbstract();
1159 }
1160
1161 /**
1162 * True if the operation has (i.e. throws any exceptions) false otherwise.
1163 * @see OperationFacade#isExceptionsPresent()
1164 */
1165 public boolean isExceptionsPresent()
1166 {
1167 return this.getSuperOperationFacade().isExceptionsPresent();
1168 }
1169
1170 /**
1171 * IsLeaf property in the operation. If true, operation is final, cannot be extended or
1172 * implemented by a descendant. Default=false.
1173 * @see OperationFacade#isLeaf()
1174 */
1175 public boolean isLeaf()
1176 {
1177 return this.getSuperOperationFacade().isLeaf();
1178 }
1179
1180 /**
1181 * UML2 only. If the return type parameter multiplicity>1 OR the operation multiplicity>1.
1182 * Default=false.
1183 * @see OperationFacade#isMany()
1184 */
1185 public boolean isMany()
1186 {
1187 return this.getSuperOperationFacade().isMany();
1188 }
1189
1190 /**
1191 * UML2 only: If isMany (Collection type returned), is the type unique within the collection.
1192 * Unique+Ordered determines CollectionType implementation of return result. Default=false.
1193 * @see OperationFacade#isOrdered()
1194 */
1195 public boolean isOrdered()
1196 {
1197 return this.getSuperOperationFacade().isOrdered();
1198 }
1199
1200 /**
1201 * True if this operation overrides an operation defined in an ancestor class. An operation
1202 * overrides when the names of the operations as well as the types of the arguments are equal.
1203 * The return type may be different and is, as well as any exceptions, ignored.
1204 * @see OperationFacade#isOverriding()
1205 */
1206 public boolean isOverriding()
1207 {
1208 return this.getSuperOperationFacade().isOverriding();
1209 }
1210
1211 /**
1212 * Whether any postcondition constraints are present on this operation.
1213 * @see OperationFacade#isPostconditionsPresent()
1214 */
1215 public boolean isPostconditionsPresent()
1216 {
1217 return this.getSuperOperationFacade().isPostconditionsPresent();
1218 }
1219
1220 /**
1221 * Whether any precondition constraints are present on this operation.
1222 * @see OperationFacade#isPreconditionsPresent()
1223 */
1224 public boolean isPreconditionsPresent()
1225 {
1226 return this.getSuperOperationFacade().isPreconditionsPresent();
1227 }
1228
1229 /**
1230 * Indicates whether or not this operation is a query operation.
1231 * @see OperationFacade#isQuery()
1232 */
1233 public boolean isQuery()
1234 {
1235 return this.getSuperOperationFacade().isQuery();
1236 }
1237
1238 /**
1239 * True/false depending on whether or not the operation has a return type or not (i.e. a return
1240 * type of something other than void).
1241 * @see OperationFacade#isReturnTypePresent()
1242 */
1243 public boolean isReturnTypePresent()
1244 {
1245 return this.getSuperOperationFacade().isReturnTypePresent();
1246 }
1247
1248 /**
1249 * True is the operation is static (only a single instance can be instantiated).
1250 * @see OperationFacade#isStatic()
1251 */
1252 public boolean isStatic()
1253 {
1254 return this.getSuperOperationFacade().isStatic();
1255 }
1256
1257 /**
1258 * UML2 only: for Collection return type, is the type unique within the collection.
1259 * Unique+Ordered determines the returned CollectionType. Default=false.
1260 * @see OperationFacade#isUnique()
1261 */
1262 public boolean isUnique()
1263 {
1264 return this.getSuperOperationFacade().isUnique();
1265 }
1266
1267 /**
1268 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
1269 */
1270 @Override
1271 public void initialize()
1272 {
1273 this.getSuperOperationFacade().initialize();
1274 }
1275
1276 /**
1277 * @return Object getSuperOperationFacade().getValidationOwner()
1278 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
1279 */
1280 @Override
1281 public Object getValidationOwner()
1282 {
1283 Object owner = this.getSuperOperationFacade().getValidationOwner();
1284 return owner;
1285 }
1286
1287 /**
1288 * @return String getSuperOperationFacade().getValidationName()
1289 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
1290 */
1291 @Override
1292 public String getValidationName()
1293 {
1294 String name = this.getSuperOperationFacade().getValidationName();
1295 return name;
1296 }
1297
1298 /**
1299 * @param validationMessages Collection<ModelValidationMessage>
1300 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(Collection validationMessages)
1301 */
1302 @Override
1303 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1304 {
1305 this.getSuperOperationFacade().validateInvariants(validationMessages);
1306 }
1307
1308 /**
1309 * The property that stores the name of the metafacade.
1310 */
1311 private static final String NAME_PROPERTY = "name";
1312 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1313
1314 /**
1315 * @see Object#toString()
1316 */
1317 @Override
1318 public String toString()
1319 {
1320 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1321 toString.append("[");
1322 try
1323 {
1324 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1325 }
1326 catch (final Throwable tryAgain)
1327 {
1328 try
1329 {
1330 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1331 }
1332 catch (final Throwable ignore)
1333 {
1334 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1335 }
1336 }
1337 toString.append("]");
1338 return toString.toString();
1339 }
1340 }