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