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