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