1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.bpm4struts.metafacades;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.common.Introspector;
10 import org.andromda.core.metafacade.MetafacadeBase;
11 import org.andromda.core.metafacade.MetafacadeFactory;
12 import org.andromda.core.metafacade.ModelValidationMessage;
13 import org.andromda.metafacades.uml.AssociationEndFacade;
14 import org.andromda.metafacades.uml.AttributeFacade;
15 import org.andromda.metafacades.uml.ClassifierFacade;
16 import org.andromda.metafacades.uml.ConstraintFacade;
17 import org.andromda.metafacades.uml.DependencyFacade;
18 import org.andromda.metafacades.uml.FrontEndAction;
19 import org.andromda.metafacades.uml.FrontEndController;
20 import org.andromda.metafacades.uml.FrontEndUseCase;
21 import org.andromda.metafacades.uml.GeneralizableElementFacade;
22 import org.andromda.metafacades.uml.GeneralizationFacade;
23 import org.andromda.metafacades.uml.ModelElementFacade;
24 import org.andromda.metafacades.uml.ModelFacade;
25 import org.andromda.metafacades.uml.OperationFacade;
26 import org.andromda.metafacades.uml.PackageFacade;
27 import org.andromda.metafacades.uml.StateMachineFacade;
28 import org.andromda.metafacades.uml.StereotypeFacade;
29 import org.andromda.metafacades.uml.TaggedValueFacade;
30 import org.andromda.metafacades.uml.TemplateParameterFacade;
31 import org.andromda.metafacades.uml.TypeMappings;
32 import org.andromda.translation.ocl.validation.OCLCollections;
33 import org.andromda.translation.ocl.validation.OCLExpressions;
34 import org.andromda.translation.ocl.validation.OCLIntrospector;
35 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
36 import org.apache.commons.collections.Transformer;
37 import org.apache.log4j.Logger;
38
39 /**
40 * A controller is assigned as the context of a use-case. All manual implementation is done in the
41 * controller as Struts actions may result in derferring method calls to this controller.
42 * MetafacadeLogic for StrutsController
43 *
44 * @see StrutsController
45 */
46 public abstract class StrutsControllerLogic
47 extends MetafacadeBase
48 implements StrutsController
49 {
50 /**
51 * The underlying UML object
52 * @see Object
53 */
54 protected Object metaObject;
55
56 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
57 * @param metaObjectIn
58 * @param context
59 */
60 protected StrutsControllerLogic(Object metaObjectIn, String context)
61 {
62 super(metaObjectIn, getContext(context));
63 this.superFrontEndController =
64 (FrontEndController)
65 MetafacadeFactory.getInstance().createFacadeImpl(
66 "org.andromda.metafacades.uml.FrontEndController",
67 metaObjectIn,
68 getContext(context));
69 this.metaObject = metaObjectIn;
70 }
71
72 /**
73 * The logger instance.
74 */
75 private static final Logger logger = Logger.getLogger(StrutsControllerLogic.class);
76
77 /**
78 * Gets the context for this metafacade logic instance.
79 * @param context String. Set to StrutsController if null
80 * @return context String
81 */
82 private static String getContext(String context)
83 {
84 if (context == null)
85 {
86 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsController";
87 }
88 return context;
89 }
90
91 private FrontEndController superFrontEndController;
92 private boolean superFrontEndControllerInitialized = false;
93
94 /**
95 * Gets the FrontEndController parent instance.
96 * @return this.superFrontEndController FrontEndController
97 */
98 private FrontEndController getSuperFrontEndController()
99 {
100 if (!this.superFrontEndControllerInitialized)
101 {
102 ((MetafacadeBase)this.superFrontEndController).setMetafacadeContext(this.getMetafacadeContext());
103 this.superFrontEndControllerInitialized = true;
104 }
105 return this.superFrontEndController;
106 }
107
108 /** Reset context only for non-root metafacades
109 * @param context
110 * @see MetafacadeBase#resetMetafacadeContext(String context)
111 */
112 @Override
113 public void resetMetafacadeContext(String context)
114 {
115 if (!this.contextRoot) // reset context only for non-root metafacades
116 {
117 context = getContext(context); // to have same value as in original constructor call
118 setMetafacadeContext (context);
119 if (this.superFrontEndControllerInitialized)
120 {
121 ((MetafacadeBase)this.superFrontEndController).resetMetafacadeContext(context);
122 }
123 }
124 }
125
126 /**
127 * @return boolean true always
128 * @see StrutsController
129 */
130 public boolean isStrutsControllerMetaType()
131 {
132 return true;
133 }
134
135 // --------------- attributes ---------------------
136
137 /**
138 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsController#getFullPath()
139 * @return String
140 */
141 protected abstract String handleGetFullPath();
142
143 /**
144 * The full path to this controller (that is the full file system path made up from the package
145 * and name).
146 * @return (String)handleGetFullPath()
147 */
148 public final String getFullPath()
149 {
150 String fullPath1a = null;
151 // fullPath has no pre constraints
152 fullPath1a = handleGetFullPath();
153 // fullPath has no post constraints
154 return fullPath1a;
155 }
156
157 // ------------- associations ------------------
158
159 private List<StrutsSessionObject> __getSessionObjects1r;
160 private boolean __getSessionObjects1rSet = false;
161
162 /**
163 * A controller is assigned as the context of a use-case. All manual implementation is done in
164 * the
165 * controller as Struts actions may result in derferring method calls to this controller.
166 * @return (List<StrutsSessionObject>)handleGetSessionObjects()
167 */
168 public final List<StrutsSessionObject> getSessionObjects()
169 {
170 List<StrutsSessionObject> getSessionObjects1r = this.__getSessionObjects1r;
171 if (!this.__getSessionObjects1rSet)
172 {
173 // strutsController has no pre constraints
174 List result = handleGetSessionObjects();
175 List shieldedResult = this.shieldedElements(result);
176 try
177 {
178 getSessionObjects1r = (List<StrutsSessionObject>)shieldedResult;
179 }
180 catch (ClassCastException ex)
181 {
182 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
183 StrutsControllerLogic.logger.warn("incorrect metafacade cast for StrutsControllerLogic.getSessionObjects List<StrutsSessionObject> " + result + ": " + shieldedResult);
184 }
185 // strutsController has no post constraints
186 this.__getSessionObjects1r = getSessionObjects1r;
187 if (isMetafacadePropertyCachingEnabled())
188 {
189 this.__getSessionObjects1rSet = true;
190 }
191 }
192 return getSessionObjects1r;
193 }
194
195 /**
196 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
197 * @return List
198 */
199 protected abstract List handleGetSessionObjects();
200
201 private List<StrutsParameter> __getAllArguments2r;
202 private boolean __getAllArguments2rSet = false;
203
204 /**
205 * A controller is assigned as the context of a use-case. All manual implementation is done in
206 * the
207 * controller as Struts actions may result in derferring method calls to this controller.
208 * @return (List<StrutsParameter>)handleGetAllArguments()
209 */
210 public final List<StrutsParameter> getAllArguments()
211 {
212 List<StrutsParameter> getAllArguments2r = this.__getAllArguments2r;
213 if (!this.__getAllArguments2rSet)
214 {
215 // strutsController has no pre constraints
216 List result = handleGetAllArguments();
217 List shieldedResult = this.shieldedElements(result);
218 try
219 {
220 getAllArguments2r = (List<StrutsParameter>)shieldedResult;
221 }
222 catch (ClassCastException ex)
223 {
224 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
225 StrutsControllerLogic.logger.warn("incorrect metafacade cast for StrutsControllerLogic.getAllArguments List<StrutsParameter> " + result + ": " + shieldedResult);
226 }
227 // strutsController has no post constraints
228 this.__getAllArguments2r = getAllArguments2r;
229 if (isMetafacadePropertyCachingEnabled())
230 {
231 this.__getAllArguments2rSet = true;
232 }
233 }
234 return getAllArguments2r;
235 }
236
237 /**
238 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
239 * @return List
240 */
241 protected abstract List handleGetAllArguments();
242
243 /**
244 * @return true
245 * @see FrontEndController
246 */
247 public boolean isFrontEndControllerMetaType()
248 {
249 return true;
250 }
251
252 /**
253 * @return true
254 * @see ClassifierFacade
255 */
256 public boolean isClassifierFacadeMetaType()
257 {
258 return true;
259 }
260
261 /**
262 * @return true
263 * @see GeneralizableElementFacade
264 */
265 public boolean isGeneralizableElementFacadeMetaType()
266 {
267 return true;
268 }
269
270 /**
271 * @return true
272 * @see ModelElementFacade
273 */
274 public boolean isModelElementFacadeMetaType()
275 {
276 return true;
277 }
278
279 // ----------- delegates to FrontEndController ------------
280 /**
281 * Return the attribute which name matches the parameter
282 * @see ClassifierFacade#findAttribute(String name)
283 */
284 public AttributeFacade findAttribute(String name)
285 {
286 return this.getSuperFrontEndController().findAttribute(name);
287 }
288
289 /**
290 * Those abstraction dependencies for which this classifier is the client.
291 * @see ClassifierFacade#getAbstractions()
292 */
293 public Collection<ClassifierFacade> getAbstractions()
294 {
295 return this.getSuperFrontEndController().getAbstractions();
296 }
297
298 /**
299 * Lists all classes associated to this one and any ancestor classes (through generalization).
300 * There will be no duplicates. The order of the elements is predictable.
301 * @see ClassifierFacade#getAllAssociatedClasses()
302 */
303 public Collection<ClassifierFacade> getAllAssociatedClasses()
304 {
305 return this.getSuperFrontEndController().getAllAssociatedClasses();
306 }
307
308 /**
309 * A collection containing all 'properties' of the classifier and its ancestors. Properties are
310 * any attributes and navigable connecting association ends.
311 * @see ClassifierFacade#getAllProperties()
312 */
313 public Collection<ModelElementFacade> getAllProperties()
314 {
315 return this.getSuperFrontEndController().getAllProperties();
316 }
317
318 /**
319 * A collection containing all required and/or read-only 'properties' of the classifier and its
320 * ancestors. Properties are any attributes and navigable connecting association ends.
321 * @see ClassifierFacade#getAllRequiredConstructorParameters()
322 */
323 public Collection<ModelElementFacade> getAllRequiredConstructorParameters()
324 {
325 return this.getSuperFrontEndController().getAllRequiredConstructorParameters();
326 }
327
328 /**
329 * Gets the array type for this classifier. If this classifier already represents an array, it
330 * just returns itself.
331 * @see ClassifierFacade#getArray()
332 */
333 public ClassifierFacade getArray()
334 {
335 return this.getSuperFrontEndController().getArray();
336 }
337
338 /**
339 * The name of the classifier as an array.
340 * @see ClassifierFacade#getArrayName()
341 */
342 public String getArrayName()
343 {
344 return this.getSuperFrontEndController().getArrayName();
345 }
346
347 /**
348 * Lists the classes associated to this one, there is no repitition of classes. The order of the
349 * elements is predictable.
350 * @see ClassifierFacade#getAssociatedClasses()
351 */
352 public Collection<ClassifierFacade> getAssociatedClasses()
353 {
354 return this.getSuperFrontEndController().getAssociatedClasses();
355 }
356
357 /**
358 * Gets the association ends belonging to a classifier.
359 * @see ClassifierFacade#getAssociationEnds()
360 */
361 public List<AssociationEndFacade> getAssociationEnds()
362 {
363 return this.getSuperFrontEndController().getAssociationEnds();
364 }
365
366 /**
367 * Gets the attributes that belong to the classifier.
368 * @see ClassifierFacade#getAttributes()
369 */
370 public List<AttributeFacade> getAttributes()
371 {
372 return this.getSuperFrontEndController().getAttributes();
373 }
374
375 /**
376 * Gets all attributes for the classifier and if 'follow' is true goes up the inheritance
377 * hierarchy and gets the attributes from the super classes as well.
378 * @see ClassifierFacade#getAttributes(boolean follow)
379 */
380 public List<AttributeFacade> getAttributes(boolean follow)
381 {
382 return this.getSuperFrontEndController().getAttributes(follow);
383 }
384
385 /**
386 * The fully qualified name of the classifier as an array.
387 * @see ClassifierFacade#getFullyQualifiedArrayName()
388 */
389 public String getFullyQualifiedArrayName()
390 {
391 return this.getSuperFrontEndController().getFullyQualifiedArrayName();
392 }
393
394 /**
395 * Returns all those operations that could be implemented at this classifier's level. This means
396 * the operations owned by this classifier as well as any realized interface's operations
397 * (recursively) in case this classifier itself is not already an interface, or generalized when
398 * this classifier is an interface.
399 * @see ClassifierFacade#getImplementationOperations()
400 */
401 public Collection<OperationFacade> getImplementationOperations()
402 {
403 return this.getSuperFrontEndController().getImplementationOperations();
404 }
405
406 /**
407 * A comma separated list of the fully qualified names of all implemented interfaces.
408 * @see ClassifierFacade#getImplementedInterfaceList()
409 */
410 public String getImplementedInterfaceList()
411 {
412 return this.getSuperFrontEndController().getImplementedInterfaceList();
413 }
414
415 /**
416 * Those attributes that are scoped to an instance of this class.
417 * @see ClassifierFacade#getInstanceAttributes()
418 */
419 public Collection<AttributeFacade> getInstanceAttributes()
420 {
421 return this.getSuperFrontEndController().getInstanceAttributes();
422 }
423
424 /**
425 * Those operations that are scoped to an instance of this class.
426 * @see ClassifierFacade#getInstanceOperations()
427 */
428 public List<OperationFacade> getInstanceOperations()
429 {
430 return this.getSuperFrontEndController().getInstanceOperations();
431 }
432
433 /**
434 * Those interfaces that are abstractions of this classifier, this basically means this
435 * classifier realizes them.
436 * @see ClassifierFacade#getInterfaceAbstractions()
437 */
438 public Collection<ClassifierFacade> getInterfaceAbstractions()
439 {
440 return this.getSuperFrontEndController().getInterfaceAbstractions();
441 }
442
443 /**
444 * A String representing a new Constructor declaration for this classifier type to be used in a
445 * Java environment.
446 * @see ClassifierFacade#getJavaNewString()
447 */
448 public String getJavaNewString()
449 {
450 return this.getSuperFrontEndController().getJavaNewString();
451 }
452
453 /**
454 * A String representing the null-value for this classifier type to be used in a Java
455 * environment.
456 * @see ClassifierFacade#getJavaNullString()
457 */
458 public String getJavaNullString()
459 {
460 return this.getSuperFrontEndController().getJavaNullString();
461 }
462
463 /**
464 * The other ends of this classifier's association ends which are navigable.
465 * @see ClassifierFacade#getNavigableConnectingEnds()
466 */
467 public Collection<AssociationEndFacade> getNavigableConnectingEnds()
468 {
469 return this.getSuperFrontEndController().getNavigableConnectingEnds();
470 }
471
472 /**
473 * Get the other ends of this classifier's association ends which are navigable and if 'follow'
474 * is true goes up the inheritance hierarchy and gets the super association ends as well.
475 * @see ClassifierFacade#getNavigableConnectingEnds(boolean follow)
476 */
477 public List<AssociationEndFacade> getNavigableConnectingEnds(boolean follow)
478 {
479 return this.getSuperFrontEndController().getNavigableConnectingEnds(follow);
480 }
481
482 /**
483 * Assuming that the classifier is an array, this will return the non array type of the
484 * classifier from
485 * the model. If the classifier is NOT an array, it will just return itself.
486 * @see ClassifierFacade#getNonArray()
487 */
488 public ClassifierFacade getNonArray()
489 {
490 return this.getSuperFrontEndController().getNonArray();
491 }
492
493 /**
494 * The attributes from this classifier in the form of an operation call (this example would be
495 * in Java): '(String attributeOne, String attributeTwo). If there were no attributes on the
496 * classifier, the result would be an empty '()'.
497 * @see ClassifierFacade#getOperationCallFromAttributes()
498 */
499 public String getOperationCallFromAttributes()
500 {
501 return this.getSuperFrontEndController().getOperationCallFromAttributes();
502 }
503
504 /**
505 * The operations owned by this classifier.
506 * @see ClassifierFacade#getOperations()
507 */
508 public List<OperationFacade> getOperations()
509 {
510 return this.getSuperFrontEndController().getOperations();
511 }
512
513 /**
514 * A collection containing all 'properties' of the classifier. Properties are any attributes
515 * and navigable connecting association ends.
516 * @see ClassifierFacade#getProperties()
517 */
518 public List<ModelElementFacade> getProperties()
519 {
520 return this.getSuperFrontEndController().getProperties();
521 }
522
523 /**
524 * Gets all properties (attributes and navigable association ends) for the classifier and if
525 * 'follow' is true goes up the inheritance hierarchy and gets the properties from the super
526 * classes as well.
527 * @see ClassifierFacade#getProperties(boolean follow)
528 */
529 public List getProperties(boolean follow)
530 {
531 return this.getSuperFrontEndController().getProperties(follow);
532 }
533
534 /**
535 * A collection containing all required and/or read-only 'properties' of the classifier.
536 * Properties are any attributes and navigable connecting association ends.
537 * @see ClassifierFacade#getRequiredConstructorParameters()
538 */
539 public Collection<ModelElementFacade> getRequiredConstructorParameters()
540 {
541 return this.getSuperFrontEndController().getRequiredConstructorParameters();
542 }
543
544 /**
545 * Returns the serial version UID of the underlying model element.
546 * @see ClassifierFacade#getSerialVersionUID()
547 */
548 public long getSerialVersionUID()
549 {
550 return this.getSuperFrontEndController().getSerialVersionUID();
551 }
552
553 /**
554 * Those attributes that are scoped to the definition of this class.
555 * @see ClassifierFacade#getStaticAttributes()
556 */
557 public Collection<AttributeFacade> getStaticAttributes()
558 {
559 return this.getSuperFrontEndController().getStaticAttributes();
560 }
561
562 /**
563 * Those operations that are scoped to the definition of this class.
564 * @see ClassifierFacade#getStaticOperations()
565 */
566 public List<OperationFacade> getStaticOperations()
567 {
568 return this.getSuperFrontEndController().getStaticOperations();
569 }
570
571 /**
572 * This class' superclass, returns the generalization if it is a ClassifierFacade, null
573 * otherwise.
574 * @see ClassifierFacade#getSuperClass()
575 */
576 public ClassifierFacade getSuperClass()
577 {
578 return this.getSuperFrontEndController().getSuperClass();
579 }
580
581 /**
582 * The wrapper name for this classifier if a mapped type has a defined wrapper class (ie. 'long'
583 * maps to 'Long'). If the classifier doesn't have a wrapper defined for it, this method will
584 * return a null. Note that wrapper mappings must be defined for the namespace by defining the
585 * 'wrapperMappingsUri', this property must point to the location of the mappings file which
586 * maps the primitives to wrapper types.
587 * @see ClassifierFacade#getWrapperName()
588 */
589 public String getWrapperName()
590 {
591 return this.getSuperFrontEndController().getWrapperName();
592 }
593
594 /**
595 * Indicates if this classifier is 'abstract'.
596 * @see ClassifierFacade#isAbstract()
597 */
598 public boolean isAbstract()
599 {
600 return this.getSuperFrontEndController().isAbstract();
601 }
602
603 /**
604 * True if this classifier represents an array type. False otherwise.
605 * @see ClassifierFacade#isArrayType()
606 */
607 public boolean isArrayType()
608 {
609 return this.getSuperFrontEndController().isArrayType();
610 }
611
612 /**
613 * True if the ClassifierFacade is an AssociationClass.
614 * @see ClassifierFacade#isAssociationClass()
615 */
616 public boolean isAssociationClass()
617 {
618 return this.getSuperFrontEndController().isAssociationClass();
619 }
620
621 /**
622 * Returns true if this type represents a Blob type.
623 * @see ClassifierFacade#isBlobType()
624 */
625 public boolean isBlobType()
626 {
627 return this.getSuperFrontEndController().isBlobType();
628 }
629
630 /**
631 * Indicates if this type represents a boolean type or not.
632 * @see ClassifierFacade#isBooleanType()
633 */
634 public boolean isBooleanType()
635 {
636 return this.getSuperFrontEndController().isBooleanType();
637 }
638
639 /**
640 * Indicates if this type represents a char, Character, or java.lang.Character type or not.
641 * @see ClassifierFacade#isCharacterType()
642 */
643 public boolean isCharacterType()
644 {
645 return this.getSuperFrontEndController().isCharacterType();
646 }
647
648 /**
649 * Returns true if this type represents a Clob type.
650 * @see ClassifierFacade#isClobType()
651 */
652 public boolean isClobType()
653 {
654 return this.getSuperFrontEndController().isClobType();
655 }
656
657 /**
658 * True if this classifier represents a collection type. False otherwise.
659 * @see ClassifierFacade#isCollectionType()
660 */
661 public boolean isCollectionType()
662 {
663 return this.getSuperFrontEndController().isCollectionType();
664 }
665
666 /**
667 * True/false depending on whether or not this classifier represents a datatype. A data type is
668 * a type whose instances are identified only by their value. A data type may contain attributes
669 * to support the modeling of structured data types.
670 * @see ClassifierFacade#isDataType()
671 */
672 public boolean isDataType()
673 {
674 return this.getSuperFrontEndController().isDataType();
675 }
676
677 /**
678 * True when this classifier is a date type.
679 * @see ClassifierFacade#isDateType()
680 */
681 public boolean isDateType()
682 {
683 return this.getSuperFrontEndController().isDateType();
684 }
685
686 /**
687 * Indicates if this type represents a Double type or not.
688 * @see ClassifierFacade#isDoubleType()
689 */
690 public boolean isDoubleType()
691 {
692 return this.getSuperFrontEndController().isDoubleType();
693 }
694
695 /**
696 * Indicates whether or not this classifier represents an "EmbeddedValue'.
697 * @see ClassifierFacade#isEmbeddedValue()
698 */
699 public boolean isEmbeddedValue()
700 {
701 return this.getSuperFrontEndController().isEmbeddedValue();
702 }
703
704 /**
705 * True if this classifier is in fact marked as an enumeration.
706 * @see ClassifierFacade#isEnumeration()
707 */
708 public boolean isEnumeration()
709 {
710 return this.getSuperFrontEndController().isEnumeration();
711 }
712
713 /**
714 * Returns true if this type represents a 'file' type.
715 * @see ClassifierFacade#isFileType()
716 */
717 public boolean isFileType()
718 {
719 return this.getSuperFrontEndController().isFileType();
720 }
721
722 /**
723 * Indicates if this type represents a Float type or not.
724 * @see ClassifierFacade#isFloatType()
725 */
726 public boolean isFloatType()
727 {
728 return this.getSuperFrontEndController().isFloatType();
729 }
730
731 /**
732 * Indicates if this type represents an int or Integer or java.lang.Integer type or not.
733 * @see ClassifierFacade#isIntegerType()
734 */
735 public boolean isIntegerType()
736 {
737 return this.getSuperFrontEndController().isIntegerType();
738 }
739
740 /**
741 * True/false depending on whether or not this Classifier represents an interface.
742 * @see ClassifierFacade#isInterface()
743 */
744 public boolean isInterface()
745 {
746 return this.getSuperFrontEndController().isInterface();
747 }
748
749 /**
750 * True if this classifier cannot be extended and represent a leaf in the inheritance tree.
751 * @see ClassifierFacade#isLeaf()
752 */
753 public boolean isLeaf()
754 {
755 return this.getSuperFrontEndController().isLeaf();
756 }
757
758 /**
759 * True if this classifier represents a list type. False otherwise.
760 * @see ClassifierFacade#isListType()
761 */
762 public boolean isListType()
763 {
764 return this.getSuperFrontEndController().isListType();
765 }
766
767 /**
768 * Indicates if this type represents a Long type or not.
769 * @see ClassifierFacade#isLongType()
770 */
771 public boolean isLongType()
772 {
773 return this.getSuperFrontEndController().isLongType();
774 }
775
776 /**
777 * Indicates whether or not this classifier represents a Map type.
778 * @see ClassifierFacade#isMapType()
779 */
780 public boolean isMapType()
781 {
782 return this.getSuperFrontEndController().isMapType();
783 }
784
785 /**
786 * Indicates whether or not this classifier represents a primitive type.
787 * @see ClassifierFacade#isPrimitive()
788 */
789 public boolean isPrimitive()
790 {
791 return this.getSuperFrontEndController().isPrimitive();
792 }
793
794 /**
795 * True if this classifier represents a set type. False otherwise.
796 * @see ClassifierFacade#isSetType()
797 */
798 public boolean isSetType()
799 {
800 return this.getSuperFrontEndController().isSetType();
801 }
802
803 /**
804 * Indicates whether or not this classifier represents a string type.
805 * @see ClassifierFacade#isStringType()
806 */
807 public boolean isStringType()
808 {
809 return this.getSuperFrontEndController().isStringType();
810 }
811
812 /**
813 * Indicates whether or not this classifier represents a time type.
814 * @see ClassifierFacade#isTimeType()
815 */
816 public boolean isTimeType()
817 {
818 return this.getSuperFrontEndController().isTimeType();
819 }
820
821 /**
822 * Returns true if this type is a wrapped primitive type.
823 * @see ClassifierFacade#isWrappedPrimitive()
824 */
825 public boolean isWrappedPrimitive()
826 {
827 return this.getSuperFrontEndController().isWrappedPrimitive();
828 }
829
830 /**
831 * All actions that defer to at least one operation of this controller.
832 * @see FrontEndController#getDeferringActions()
833 */
834 public List<FrontEndAction> getDeferringActions()
835 {
836 return this.getSuperFrontEndController().getDeferringActions();
837 }
838
839 /**
840 * Returns all back-end services referenced by this controller.
841 * @see FrontEndController#getServiceReferences()
842 */
843 public List<DependencyFacade> getServiceReferences()
844 {
845 return this.getSuperFrontEndController().getServiceReferences();
846 }
847
848 /**
849 * Returns the use-case "controlled" by this controller.
850 * @see FrontEndController#getUseCase()
851 */
852 public FrontEndUseCase getUseCase()
853 {
854 return this.getSuperFrontEndController().getUseCase();
855 }
856
857 /**
858 * Finds the tagged value optional searching the entire inheritance hierarchy if 'follow' is set
859 * to true.
860 * @see GeneralizableElementFacade#findTaggedValue(String tagName, boolean follow)
861 */
862 public Object findTaggedValue(String tagName, boolean follow)
863 {
864 return this.getSuperFrontEndController().findTaggedValue(tagName, follow);
865 }
866
867 /**
868 * All generalizations for this generalizable element, goes up the inheritance tree.
869 * @see GeneralizableElementFacade#getAllGeneralizations()
870 */
871 public Collection<GeneralizableElementFacade> getAllGeneralizations()
872 {
873 return this.getSuperFrontEndController().getAllGeneralizations();
874 }
875
876 /**
877 * All specializations (travels down the inheritance hierarchy).
878 * @see GeneralizableElementFacade#getAllSpecializations()
879 */
880 public Collection<GeneralizableElementFacade> getAllSpecializations()
881 {
882 return this.getSuperFrontEndController().getAllSpecializations();
883 }
884
885 /**
886 * Gets the direct generalization for this generalizable element.
887 * @see GeneralizableElementFacade#getGeneralization()
888 */
889 public GeneralizableElementFacade getGeneralization()
890 {
891 return this.getSuperFrontEndController().getGeneralization();
892 }
893
894 /**
895 * Gets the actual links that this generalization element is part of (it plays either the
896 * specialization or generalization).
897 * @see GeneralizableElementFacade#getGeneralizationLinks()
898 */
899 public Collection<GeneralizationFacade> getGeneralizationLinks()
900 {
901 return this.getSuperFrontEndController().getGeneralizationLinks();
902 }
903
904 /**
905 * A comma separated list of the fully qualified names of all generalizations.
906 * @see GeneralizableElementFacade#getGeneralizationList()
907 */
908 public String getGeneralizationList()
909 {
910 return this.getSuperFrontEndController().getGeneralizationList();
911 }
912
913 /**
914 * The element found when you recursively follow the generalization path up to the root. If an
915 * element has no generalization itself will be considered the root.
916 * @see GeneralizableElementFacade#getGeneralizationRoot()
917 */
918 public GeneralizableElementFacade getGeneralizationRoot()
919 {
920 return this.getSuperFrontEndController().getGeneralizationRoot();
921 }
922
923 /**
924 * Return all generalizations (ancestors) from this generalizable element.
925 * @see GeneralizableElementFacade#getGeneralizations()
926 */
927 public Collection<GeneralizableElementFacade> getGeneralizations()
928 {
929 return this.getSuperFrontEndController().getGeneralizations();
930 }
931
932 /**
933 * Gets the direct specializations (i.e. sub elements) for this generalizatble element.
934 * @see GeneralizableElementFacade#getSpecializations()
935 */
936 public Collection<GeneralizableElementFacade> getSpecializations()
937 {
938 return this.getSuperFrontEndController().getSpecializations();
939 }
940
941 /**
942 * Copies all tagged values from the given ModelElementFacade to this model element facade.
943 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
944 */
945 public void copyTaggedValues(ModelElementFacade element)
946 {
947 this.getSuperFrontEndController().copyTaggedValues(element);
948 }
949
950 /**
951 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
952 * one found will be returned.
953 * @see ModelElementFacade#findTaggedValue(String tagName)
954 */
955 public Object findTaggedValue(String tagName)
956 {
957 return this.getSuperFrontEndController().findTaggedValue(tagName);
958 }
959
960 /**
961 * Returns all the values for the tagged value with the specified name. The returned collection
962 * will contains only String instances, or will be empty. Never null.
963 * @see ModelElementFacade#findTaggedValues(String tagName)
964 */
965 public Collection<Object> findTaggedValues(String tagName)
966 {
967 return this.getSuperFrontEndController().findTaggedValues(tagName);
968 }
969
970 /**
971 * Returns the fully qualified name of the model element. The fully qualified name includes
972 * complete package qualified name of the underlying model element. The templates parameter will
973 * be replaced by the correct one given the binding relation of the parameter to this element.
974 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
975 */
976 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
977 {
978 return this.getSuperFrontEndController().getBindedFullyQualifiedName(bindedElement);
979 }
980
981 /**
982 * Gets all constraints belonging to the model element.
983 * @see ModelElementFacade#getConstraints()
984 */
985 public Collection<ConstraintFacade> getConstraints()
986 {
987 return this.getSuperFrontEndController().getConstraints();
988 }
989
990 /**
991 * Returns the constraints of the argument kind that have been placed onto this model. Typical
992 * kinds are "inv", "pre" and "post". Other kinds are possible.
993 * @see ModelElementFacade#getConstraints(String kind)
994 */
995 public Collection<ConstraintFacade> getConstraints(String kind)
996 {
997 return this.getSuperFrontEndController().getConstraints(kind);
998 }
999
1000 /**
1001 * Gets the documentation for the model element, The indent argument is prefixed to each line.
1002 * By default this method wraps lines after 64 characters.
1003 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
1004 * @see ModelElementFacade#getDocumentation(String indent)
1005 */
1006 public String getDocumentation(String indent)
1007 {
1008 return this.getSuperFrontEndController().getDocumentation(indent);
1009 }
1010
1011 /**
1012 * This method returns the documentation for this model element, with the lines wrapped after
1013 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1014 * required. By default paragraphs are returned as HTML.
1015 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
1016 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
1017 */
1018 public String getDocumentation(String indent, int lineLength)
1019 {
1020 return this.getSuperFrontEndController().getDocumentation(indent, lineLength);
1021 }
1022
1023 /**
1024 * This method returns the documentation for this model element, with the lines wrapped after
1025 * the specified number of characters, values of less than 1 will indicate no line wrapping is
1026 * required. HTML style determines if HTML Escaping is applied.
1027 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
1028 */
1029 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
1030 {
1031 return this.getSuperFrontEndController().getDocumentation(indent, lineLength, htmlStyle);
1032 }
1033
1034 /**
1035 * The fully qualified name of this model element.
1036 * @see ModelElementFacade#getFullyQualifiedName()
1037 */
1038 public String getFullyQualifiedName()
1039 {
1040 return this.getSuperFrontEndController().getFullyQualifiedName();
1041 }
1042
1043 /**
1044 * Returns the fully qualified name of the model element. The fully qualified name includes
1045 * complete package qualified name of the underlying model element. If modelName is true, then
1046 * the original name of the model element (the name contained within the model) will be the name
1047 * returned, otherwise a name from a language mapping will be returned.
1048 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
1049 */
1050 public String getFullyQualifiedName(boolean modelName)
1051 {
1052 return this.getSuperFrontEndController().getFullyQualifiedName(modelName);
1053 }
1054
1055 /**
1056 * Returns the fully qualified name as a path, the returned value always starts with out a slash
1057 * '/'.
1058 * @see ModelElementFacade#getFullyQualifiedNamePath()
1059 */
1060 public String getFullyQualifiedNamePath()
1061 {
1062 return this.getSuperFrontEndController().getFullyQualifiedNamePath();
1063 }
1064
1065 /**
1066 * Gets the unique identifier of the underlying model element.
1067 * @see ModelElementFacade#getId()
1068 */
1069 public String getId()
1070 {
1071 return this.getSuperFrontEndController().getId();
1072 }
1073
1074 /**
1075 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1076 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1077 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1078 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1079 * JDK5 compiler level.
1080 * @see ModelElementFacade#getKeywords()
1081 */
1082 public Collection<String> getKeywords()
1083 {
1084 return this.getSuperFrontEndController().getKeywords();
1085 }
1086
1087 /**
1088 * UML2: Retrieves a localized label for this named element.
1089 * @see ModelElementFacade#getLabel()
1090 */
1091 public String getLabel()
1092 {
1093 return this.getSuperFrontEndController().getLabel();
1094 }
1095
1096 /**
1097 * The language mappings that have been set for this model element.
1098 * @see ModelElementFacade#getLanguageMappings()
1099 */
1100 public TypeMappings getLanguageMappings()
1101 {
1102 return this.getSuperFrontEndController().getLanguageMappings();
1103 }
1104
1105 /**
1106 * Return the model containing this model element (multiple models may be loaded and processed
1107 * at the same time).
1108 * @see ModelElementFacade#getModel()
1109 */
1110 public ModelFacade getModel()
1111 {
1112 return this.getSuperFrontEndController().getModel();
1113 }
1114
1115 /**
1116 * The name of the model element.
1117 * @see ModelElementFacade#getName()
1118 */
1119 public String getName()
1120 {
1121 return this.getSuperFrontEndController().getName();
1122 }
1123
1124 /**
1125 * Gets the package to which this model element belongs.
1126 * @see ModelElementFacade#getPackage()
1127 */
1128 public ModelElementFacade getPackage()
1129 {
1130 return this.getSuperFrontEndController().getPackage();
1131 }
1132
1133 /**
1134 * The name of this model element's package.
1135 * @see ModelElementFacade#getPackageName()
1136 */
1137 public String getPackageName()
1138 {
1139 return this.getSuperFrontEndController().getPackageName();
1140 }
1141
1142 /**
1143 * Gets the package name (optionally providing the ability to retrieve the model name and not
1144 * the mapped name).
1145 * @see ModelElementFacade#getPackageName(boolean modelName)
1146 */
1147 public String getPackageName(boolean modelName)
1148 {
1149 return this.getSuperFrontEndController().getPackageName(modelName);
1150 }
1151
1152 /**
1153 * Returns the package as a path, the returned value always starts with out a slash '/'.
1154 * @see ModelElementFacade#getPackagePath()
1155 */
1156 public String getPackagePath()
1157 {
1158 return this.getSuperFrontEndController().getPackagePath();
1159 }
1160
1161 /**
1162 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1163 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1164 * the names of the containing namespaces starting at the root of the hierarchy and ending with
1165 * the name of the NamedElement itself.
1166 * @see ModelElementFacade#getQualifiedName()
1167 */
1168 public String getQualifiedName()
1169 {
1170 return this.getSuperFrontEndController().getQualifiedName();
1171 }
1172
1173 /**
1174 * Gets the root package for the model element.
1175 * @see ModelElementFacade#getRootPackage()
1176 */
1177 public PackageFacade getRootPackage()
1178 {
1179 return this.getSuperFrontEndController().getRootPackage();
1180 }
1181
1182 /**
1183 * Gets the dependencies for which this model element is the source.
1184 * @see ModelElementFacade#getSourceDependencies()
1185 */
1186 public Collection<DependencyFacade> getSourceDependencies()
1187 {
1188 return this.getSuperFrontEndController().getSourceDependencies();
1189 }
1190
1191 /**
1192 * If this model element is the context of an activity graph, this represents that activity
1193 * graph.
1194 * @see ModelElementFacade#getStateMachineContext()
1195 */
1196 public StateMachineFacade getStateMachineContext()
1197 {
1198 return this.getSuperFrontEndController().getStateMachineContext();
1199 }
1200
1201 /**
1202 * The collection of ALL stereotype names for this model element.
1203 * @see ModelElementFacade#getStereotypeNames()
1204 */
1205 public Collection<String> getStereotypeNames()
1206 {
1207 return this.getSuperFrontEndController().getStereotypeNames();
1208 }
1209
1210 /**
1211 * Gets all stereotypes for this model element.
1212 * @see ModelElementFacade#getStereotypes()
1213 */
1214 public Collection<StereotypeFacade> getStereotypes()
1215 {
1216 return this.getSuperFrontEndController().getStereotypes();
1217 }
1218
1219 /**
1220 * Return the TaggedValues associated with this model element, under all stereotypes.
1221 * @see ModelElementFacade#getTaggedValues()
1222 */
1223 public Collection<TaggedValueFacade> getTaggedValues()
1224 {
1225 return this.getSuperFrontEndController().getTaggedValues();
1226 }
1227
1228 /**
1229 * Gets the dependencies for which this model element is the target.
1230 * @see ModelElementFacade#getTargetDependencies()
1231 */
1232 public Collection<DependencyFacade> getTargetDependencies()
1233 {
1234 return this.getSuperFrontEndController().getTargetDependencies();
1235 }
1236
1237 /**
1238 * Get the template parameter for this model element having the parameterName
1239 * @see ModelElementFacade#getTemplateParameter(String parameterName)
1240 */
1241 public Object getTemplateParameter(String parameterName)
1242 {
1243 return this.getSuperFrontEndController().getTemplateParameter(parameterName);
1244 }
1245
1246 /**
1247 * Get the template parameters for this model element
1248 * @see ModelElementFacade#getTemplateParameters()
1249 */
1250 public Collection<TemplateParameterFacade> getTemplateParameters()
1251 {
1252 return this.getSuperFrontEndController().getTemplateParameters();
1253 }
1254
1255 /**
1256 * The visibility (i.e. public, private, protected or package) of the model element, will
1257 * attempt a lookup for these values in the language mappings (if any).
1258 * @see ModelElementFacade#getVisibility()
1259 */
1260 public String getVisibility()
1261 {
1262 return this.getSuperFrontEndController().getVisibility();
1263 }
1264
1265 /**
1266 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1267 * is taken into account when searching for the stereotype), false otherwise.
1268 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1269 */
1270 public boolean hasExactStereotype(String stereotypeName)
1271 {
1272 return this.getSuperFrontEndController().hasExactStereotype(stereotypeName);
1273 }
1274
1275 /**
1276 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1277 * pipe, semicolon, or << >>
1278 * @see ModelElementFacade#hasKeyword(String keywordName)
1279 */
1280 public boolean hasKeyword(String keywordName)
1281 {
1282 return this.getSuperFrontEndController().hasKeyword(keywordName);
1283 }
1284
1285 /**
1286 * Returns true if the model element has the specified stereotype. If the stereotype itself
1287 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1288 * one of the stereotype's ancestors has a matching name this method will return true, false
1289 * otherwise.
1290 * For example, if we have a certain stereotype called <<exception>> and a model element has a
1291 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1292 * method with 'stereotypeName' defined as 'exception' the method would return true since
1293 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
1294 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1295 * @see ModelElementFacade#hasStereotype(String stereotypeName)
1296 */
1297 public boolean hasStereotype(String stereotypeName)
1298 {
1299 return this.getSuperFrontEndController().hasStereotype(stereotypeName);
1300 }
1301
1302 /**
1303 * True if there are target dependencies from this element that are instances of BindingFacade.
1304 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1305 * @see ModelElementFacade#isBindingDependenciesPresent()
1306 */
1307 public boolean isBindingDependenciesPresent()
1308 {
1309 return this.getSuperFrontEndController().isBindingDependenciesPresent();
1310 }
1311
1312 /**
1313 * Indicates if any constraints are present on this model element.
1314 * @see ModelElementFacade#isConstraintsPresent()
1315 */
1316 public boolean isConstraintsPresent()
1317 {
1318 return this.getSuperFrontEndController().isConstraintsPresent();
1319 }
1320
1321 /**
1322 * Indicates if any documentation is present on this model element.
1323 * @see ModelElementFacade#isDocumentationPresent()
1324 */
1325 public boolean isDocumentationPresent()
1326 {
1327 return this.getSuperFrontEndController().isDocumentationPresent();
1328 }
1329
1330 /**
1331 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1332 * @see ModelElementFacade#isReservedWord()
1333 */
1334 public boolean isReservedWord()
1335 {
1336 return this.getSuperFrontEndController().isReservedWord();
1337 }
1338
1339 /**
1340 * True is there are template parameters on this model element. For UML2, applies to Class,
1341 * Operation, Property, and Parameter.
1342 * @see ModelElementFacade#isTemplateParametersPresent()
1343 */
1344 public boolean isTemplateParametersPresent()
1345 {
1346 return this.getSuperFrontEndController().isTemplateParametersPresent();
1347 }
1348
1349 /**
1350 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1351 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1352 * Enumerations and Interfaces, optionally applies on other model elements.
1353 * @see ModelElementFacade#isValidIdentifierName()
1354 */
1355 public boolean isValidIdentifierName()
1356 {
1357 return this.getSuperFrontEndController().isValidIdentifierName();
1358 }
1359
1360 /**
1361 * Searches for the constraint with the specified 'name' on this model element, and if found
1362 * translates it using the specified 'translation' from a translation library discovered by the
1363 * framework.
1364 * @see ModelElementFacade#translateConstraint(String name, String translation)
1365 */
1366 public String translateConstraint(String name, String translation)
1367 {
1368 return this.getSuperFrontEndController().translateConstraint(name, translation);
1369 }
1370
1371 /**
1372 * Translates all constraints belonging to this model element with the given 'translation'.
1373 * @see ModelElementFacade#translateConstraints(String translation)
1374 */
1375 public String[] translateConstraints(String translation)
1376 {
1377 return this.getSuperFrontEndController().translateConstraints(translation);
1378 }
1379
1380 /**
1381 * Translates the constraints of the specified 'kind' belonging to this model element.
1382 * @see ModelElementFacade#translateConstraints(String kind, String translation)
1383 */
1384 public String[] translateConstraints(String kind, String translation)
1385 {
1386 return this.getSuperFrontEndController().translateConstraints(kind, translation);
1387 }
1388
1389 /**
1390 * @see MetafacadeBase#initialize()
1391 */
1392 @Override
1393 public void initialize()
1394 {
1395 this.getSuperFrontEndController().initialize();
1396 }
1397
1398 /**
1399 * @return Object getSuperFrontEndController().getValidationOwner()
1400 * @see MetafacadeBase#getValidationOwner()
1401 */
1402 @Override
1403 public Object getValidationOwner()
1404 {
1405 Object owner = this.getSuperFrontEndController().getValidationOwner();
1406 return owner;
1407 }
1408
1409 /**
1410 * @return String getSuperFrontEndController().getValidationName()
1411 * @see MetafacadeBase#getValidationName()
1412 */
1413 @Override
1414 public String getValidationName()
1415 {
1416 String name = this.getSuperFrontEndController().getValidationName();
1417 return name;
1418 }
1419
1420 /**
1421 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name</p>
1422 * <p><b>Error:</b> Each controller must have a name, it cannot be empty.</p>
1423 * <p><b>OCL:</b> context StrutsController inv: name->notEmpty()</p>
1424 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names</p>
1425 * <p><b>Error:</b> A controller cannot have different operations with the same name, even if they have a different signature.</p>
1426 * <p><b>OCL:</b> context StrutsController inv: operations->isUnique(name)</p>
1427 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name</p>
1428 * <p><b>Error:</b> The name of this front-end controller resembles the name of the use-case it is associated with. You'll have to rename it in order to avoid naming collisions (generated files will overwrite eachother).</p>
1429 * <p><b>OCL:</b> context StrutsController inv: name <> useCase.activityGraph.firstAction.actionClassName</p>
1430 * @param validationMessages Collection<ModelValidationMessage>
1431 * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1432 */
1433 @Override
1434 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1435 {
1436 this.getSuperFrontEndController().validateInvariants(validationMessages);
1437 try
1438 {
1439 final Object contextElement = this.THIS();
1440 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")));
1441 if (!constraintValid)
1442 {
1443 validationMessages.add(
1444 new ModelValidationMessage(
1445 (MetafacadeBase)contextElement ,
1446 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name",
1447 "Each controller must have a name, it cannot be empty."));
1448 }
1449 }
1450 catch (Throwable th)
1451 {
1452 Throwable cause = th.getCause();
1453 int depth = 0; // Some throwables have infinite recursion
1454 while (cause != null && depth < 7)
1455 {
1456 th = cause;
1457 depth++;
1458 }
1459 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name' ON "
1460 + this.THIS().toString() + ": " + th.getMessage(), th);
1461 }
1462 try
1463 {
1464 final Object contextElement = this.THIS();
1465 boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.isUnique(OCLIntrospector.invoke(contextElement,"operations"),new Transformer(){public Object transform(Object object){return OCLIntrospector.invoke(object,"name");}}));
1466 if (!constraintValid)
1467 {
1468 validationMessages.add(
1469 new ModelValidationMessage(
1470 (MetafacadeBase)contextElement ,
1471 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names",
1472 "A controller cannot have different operations with the same name, even if they have a different signature."));
1473 }
1474 }
1475 catch (Throwable th)
1476 {
1477 Throwable cause = th.getCause();
1478 int depth = 0; // Some throwables have infinite recursion
1479 while (cause != null && depth < 7)
1480 {
1481 th = cause;
1482 depth++;
1483 }
1484 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names' ON "
1485 + this.THIS().toString() + ": " + th.getMessage(), th);
1486 }
1487 try
1488 {
1489 final Object contextElement = this.THIS();
1490 boolean constraintValid = OCLResultEnsurer.ensure(OCLExpressions.notEqual(OCLIntrospector.invoke(contextElement,"name"),OCLIntrospector.invoke(contextElement,"useCase.activityGraph.firstAction.actionClassName")));
1491 if (!constraintValid)
1492 {
1493 validationMessages.add(
1494 new ModelValidationMessage(
1495 (MetafacadeBase)contextElement ,
1496 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name",
1497 "The name of this front-end controller resembles the name of the use-case it is associated with. You'll have to rename it in order to avoid naming collisions (generated files will overwrite eachother)."));
1498 }
1499 }
1500 catch (Throwable th)
1501 {
1502 Throwable cause = th.getCause();
1503 int depth = 0; // Some throwables have infinite recursion
1504 while (cause != null && depth < 7)
1505 {
1506 th = cause;
1507 depth++;
1508 }
1509 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name' ON "
1510 + this.THIS().toString() + ": " + th.getMessage(), th);
1511 }
1512 }
1513
1514 /**
1515 * The property that stores the name of the metafacade.
1516 */
1517 private static final String NAME_PROPERTY = "name";
1518 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1519
1520 /**
1521 * @see Object#toString()
1522 */
1523 @Override
1524 public String toString()
1525 {
1526 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1527 toString.append("[");
1528 try
1529 {
1530 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1531 }
1532 catch (final Throwable tryAgain)
1533 {
1534 try
1535 {
1536 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1537 }
1538 catch (final Throwable ignore)
1539 {
1540 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1541 }
1542 }
1543 toString.append("]");
1544 return toString.toString();
1545 }
1546 }