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