1
2
3
4 package org.andromda.cartridges.bpm4struts.metafacades;
5
6 /***
7 * MetafacadeLogic for org.andromda.cartridges.bpm4struts.metafacades.StrutsController
8 *
9 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsController
10 */
11 public abstract class StrutsControllerLogic
12 extends org.andromda.core.metafacade.MetafacadeBase
13 implements org.andromda.cartridges.bpm4struts.metafacades.StrutsController
14 {
15
16 protected Object metaObject;
17
18 public StrutsControllerLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.superFrontEndController =
22 (org.andromda.metafacades.uml.FrontEndController)
23 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24 "org.andromda.metafacades.uml.FrontEndController",
25 metaObject,
26 getContext(context));
27 this.metaObject = metaObject;
28 }
29
30 /***
31 * Gets the context for this metafacade logic instance.
32 */
33 private static String getContext(String context)
34 {
35 if (context == null)
36 {
37 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsController";
38 }
39 return context;
40 }
41
42 private org.andromda.metafacades.uml.FrontEndController superFrontEndController;
43 private boolean superFrontEndControllerInitialized = false;
44
45 /***
46 * Gets the org.andromda.metafacades.uml.FrontEndController parent instance.
47 */
48 private org.andromda.metafacades.uml.FrontEndController getSuperFrontEndController()
49 {
50 if (!this.superFrontEndControllerInitialized)
51 {
52 ((org.andromda.core.metafacade.MetafacadeBase)superFrontEndController).setMetafacadeContext(this.getMetafacadeContext());
53 this.superFrontEndControllerInitialized = true;
54 }
55 return superFrontEndController;
56 }
57
58 /***
59 * @see org.andromda.core.metafacade.MetafacadeBase
60 */
61 public void resetMetafacadeContext(String context)
62 {
63 if (!this.contextRoot)
64 {
65 context = getContext(context);
66 setMetafacadeContext (context);
67 if (this.superFrontEndControllerInitialized)
68 {
69 ((org.andromda.core.metafacade.MetafacadeBase)superFrontEndController).resetMetafacadeContext(context);
70 }
71 }
72 }
73
74 /***
75 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsController
76 */
77 public boolean isStrutsControllerMetaType()
78 {
79 return true;
80 }
81
82
83
84 /***
85 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsController#getFullPath()
86 */
87 protected abstract java.lang.String handleGetFullPath();
88
89 private void handleGetFullPath1aPreCondition()
90 {
91 }
92
93 private void handleGetFullPath1aPostCondition()
94 {
95 }
96
97 public final java.lang.String getFullPath()
98 {
99 java.lang.String fullPath1a = null;
100 handleGetFullPath1aPreCondition();
101 fullPath1a = handleGetFullPath();
102 handleGetFullPath1aPostCondition();
103 return fullPath1a;
104 }
105
106
107
108 private void handleGetAllArguments2rPreCondition()
109 {
110 }
111
112 private void handleGetAllArguments2rPostCondition()
113 {
114 }
115
116 private java.util.List __getAllArguments2r;
117 private boolean __getAllArguments2rSet = false;
118
119 public final java.util.List getAllArguments()
120 {
121 java.util.List getAllArguments2r = this.__getAllArguments2r;
122 if (!this.__getAllArguments2rSet)
123 {
124 handleGetAllArguments2rPreCondition();
125 Object result = this.shieldedElements(handleGetAllArguments());
126 try
127 {
128 getAllArguments2r = (java.util.List)result;
129 }
130 catch (ClassCastException ex)
131 {
132
133
134 }
135 handleGetAllArguments2rPostCondition();
136 this.__getAllArguments2r = getAllArguments2r;
137 if (isMetafacadePropertyCachingEnabled())
138 {
139 this.__getAllArguments2rSet = true;
140 }
141 }
142 return getAllArguments2r;
143 }
144
145 protected abstract java.util.List handleGetAllArguments();
146
147 private void handleGetSessionObjects3rPreCondition()
148 {
149 }
150
151 private void handleGetSessionObjects3rPostCondition()
152 {
153 }
154
155 private java.util.List __getSessionObjects3r;
156 private boolean __getSessionObjects3rSet = false;
157
158 public final java.util.List getSessionObjects()
159 {
160 java.util.List getSessionObjects3r = this.__getSessionObjects3r;
161 if (!this.__getSessionObjects3rSet)
162 {
163 handleGetSessionObjects3rPreCondition();
164 Object result = this.shieldedElements(handleGetSessionObjects());
165 try
166 {
167 getSessionObjects3r = (java.util.List)result;
168 }
169 catch (ClassCastException ex)
170 {
171
172
173 }
174 handleGetSessionObjects3rPostCondition();
175 this.__getSessionObjects3r = getSessionObjects3r;
176 if (isMetafacadePropertyCachingEnabled())
177 {
178 this.__getSessionObjects3rSet = true;
179 }
180 }
181 return getSessionObjects3r;
182 }
183
184 protected abstract java.util.List handleGetSessionObjects();
185
186 /***
187 * @see org.andromda.metafacades.uml.FrontEndController
188 */
189 public boolean isFrontEndControllerMetaType()
190 {
191 return true;
192 }
193
194 /***
195 * @see org.andromda.metafacades.uml.ClassifierFacade
196 */
197 public boolean isClassifierFacadeMetaType()
198 {
199 return true;
200 }
201
202 /***
203 * @see org.andromda.metafacades.uml.GeneralizableElementFacade
204 */
205 public boolean isGeneralizableElementFacadeMetaType()
206 {
207 return true;
208 }
209
210 /***
211 * @see org.andromda.metafacades.uml.ModelElementFacade
212 */
213 public boolean isModelElementFacadeMetaType()
214 {
215 return true;
216 }
217
218
219
220 public org.andromda.metafacades.uml.AttributeFacade findAttribute(java.lang.String name)
221 {
222 return this.getSuperFrontEndController().findAttribute(name);
223 }
224
225
226 public java.util.Collection getAbstractions()
227 {
228 return this.getSuperFrontEndController().getAbstractions();
229 }
230
231
232 public java.util.Collection getAllAssociatedClasses()
233 {
234 return this.getSuperFrontEndController().getAllAssociatedClasses();
235 }
236
237
238 public java.util.Collection getAllProperties()
239 {
240 return this.getSuperFrontEndController().getAllProperties();
241 }
242
243
244 public java.util.Collection getAllRequiredConstructorParameters()
245 {
246 return this.getSuperFrontEndController().getAllRequiredConstructorParameters();
247 }
248
249
250 public org.andromda.metafacades.uml.ClassifierFacade getArray()
251 {
252 return this.getSuperFrontEndController().getArray();
253 }
254
255
256 public java.lang.String getArrayName()
257 {
258 return this.getSuperFrontEndController().getArrayName();
259 }
260
261
262 public java.util.Collection getAssociatedClasses()
263 {
264 return this.getSuperFrontEndController().getAssociatedClasses();
265 }
266
267
268 public java.util.List getAssociationEnds()
269 {
270 return this.getSuperFrontEndController().getAssociationEnds();
271 }
272
273
274 public java.util.Collection getAttributes(boolean follow)
275 {
276 return this.getSuperFrontEndController().getAttributes(follow);
277 }
278
279
280 public java.util.Collection getAttributes()
281 {
282 return this.getSuperFrontEndController().getAttributes();
283 }
284
285
286 public java.lang.String getFullyQualifiedArrayName()
287 {
288 return this.getSuperFrontEndController().getFullyQualifiedArrayName();
289 }
290
291
292 public java.util.Collection getImplementationOperations()
293 {
294 return this.getSuperFrontEndController().getImplementationOperations();
295 }
296
297
298 public java.lang.String getImplementedInterfaceList()
299 {
300 return this.getSuperFrontEndController().getImplementedInterfaceList();
301 }
302
303
304 public java.util.Collection getInstanceAttributes()
305 {
306 return this.getSuperFrontEndController().getInstanceAttributes();
307 }
308
309
310 public java.util.Collection getInstanceOperations()
311 {
312 return this.getSuperFrontEndController().getInstanceOperations();
313 }
314
315
316 public java.util.Collection getInterfaceAbstractions()
317 {
318 return this.getSuperFrontEndController().getInterfaceAbstractions();
319 }
320
321
322 public java.lang.String getJavaNullString()
323 {
324 return this.getSuperFrontEndController().getJavaNullString();
325 }
326
327
328 public java.util.Collection getNavigableConnectingEnds()
329 {
330 return this.getSuperFrontEndController().getNavigableConnectingEnds();
331 }
332
333
334 public java.util.Collection getNavigableConnectingEnds(boolean follow)
335 {
336 return this.getSuperFrontEndController().getNavigableConnectingEnds(follow);
337 }
338
339
340 public org.andromda.metafacades.uml.ClassifierFacade getNonArray()
341 {
342 return this.getSuperFrontEndController().getNonArray();
343 }
344
345
346 public java.lang.String getOperationCallFromAttributes()
347 {
348 return this.getSuperFrontEndController().getOperationCallFromAttributes();
349 }
350
351
352 public java.util.Collection getOperations()
353 {
354 return this.getSuperFrontEndController().getOperations();
355 }
356
357
358 public java.util.Collection getProperties(boolean follow)
359 {
360 return this.getSuperFrontEndController().getProperties(follow);
361 }
362
363
364 public java.util.Collection getProperties()
365 {
366 return this.getSuperFrontEndController().getProperties();
367 }
368
369
370 public java.util.Collection getRequiredConstructorParameters()
371 {
372 return this.getSuperFrontEndController().getRequiredConstructorParameters();
373 }
374
375
376 public java.lang.Long getSerialVersionUID()
377 {
378 return this.getSuperFrontEndController().getSerialVersionUID();
379 }
380
381
382 public java.util.Collection getStaticAttributes()
383 {
384 return this.getSuperFrontEndController().getStaticAttributes();
385 }
386
387
388 public java.util.Collection getStaticOperations()
389 {
390 return this.getSuperFrontEndController().getStaticOperations();
391 }
392
393
394 public org.andromda.metafacades.uml.ClassifierFacade getSuperClass()
395 {
396 return this.getSuperFrontEndController().getSuperClass();
397 }
398
399
400 public java.lang.String getWrapperName()
401 {
402 return this.getSuperFrontEndController().getWrapperName();
403 }
404
405
406 public boolean isAbstract()
407 {
408 return this.getSuperFrontEndController().isAbstract();
409 }
410
411
412 public boolean isArrayType()
413 {
414 return this.getSuperFrontEndController().isArrayType();
415 }
416
417
418 public boolean isAssociationClass()
419 {
420 return this.getSuperFrontEndController().isAssociationClass();
421 }
422
423
424 public boolean isBlobType()
425 {
426 return this.getSuperFrontEndController().isBlobType();
427 }
428
429
430 public boolean isBooleanType()
431 {
432 return this.getSuperFrontEndController().isBooleanType();
433 }
434
435
436 public boolean isClobType()
437 {
438 return this.getSuperFrontEndController().isClobType();
439 }
440
441
442 public boolean isCollectionType()
443 {
444 return this.getSuperFrontEndController().isCollectionType();
445 }
446
447
448 public boolean isDataType()
449 {
450 return this.getSuperFrontEndController().isDataType();
451 }
452
453
454 public boolean isDateType()
455 {
456 return this.getSuperFrontEndController().isDateType();
457 }
458
459
460 public boolean isEnumeration()
461 {
462 return this.getSuperFrontEndController().isEnumeration();
463 }
464
465
466 public boolean isFileType()
467 {
468 return this.getSuperFrontEndController().isFileType();
469 }
470
471
472 public boolean isInterface()
473 {
474 return this.getSuperFrontEndController().isInterface();
475 }
476
477
478 public boolean isLeaf()
479 {
480 return this.getSuperFrontEndController().isLeaf();
481 }
482
483
484 public boolean isListType()
485 {
486 return this.getSuperFrontEndController().isListType();
487 }
488
489
490 public boolean isMapType()
491 {
492 return this.getSuperFrontEndController().isMapType();
493 }
494
495
496 public boolean isPrimitive()
497 {
498 return this.getSuperFrontEndController().isPrimitive();
499 }
500
501
502 public boolean isSetType()
503 {
504 return this.getSuperFrontEndController().isSetType();
505 }
506
507
508 public boolean isStringType()
509 {
510 return this.getSuperFrontEndController().isStringType();
511 }
512
513
514 public boolean isTimeType()
515 {
516 return this.getSuperFrontEndController().isTimeType();
517 }
518
519
520 public java.util.List getDeferringActions()
521 {
522 return this.getSuperFrontEndController().getDeferringActions();
523 }
524
525
526 public java.util.List getServiceReferences()
527 {
528 return this.getSuperFrontEndController().getServiceReferences();
529 }
530
531
532 public org.andromda.metafacades.uml.FrontEndUseCase getUseCase()
533 {
534 return this.getSuperFrontEndController().getUseCase();
535 }
536
537
538 public java.lang.Object findTaggedValue(java.lang.String tagName, boolean follow)
539 {
540 return this.getSuperFrontEndController().findTaggedValue(tagName, follow);
541 }
542
543
544 public java.util.Collection getAllGeneralizations()
545 {
546 return this.getSuperFrontEndController().getAllGeneralizations();
547 }
548
549
550 public java.util.Collection getAllSpecializations()
551 {
552 return this.getSuperFrontEndController().getAllSpecializations();
553 }
554
555
556 public org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralization()
557 {
558 return this.getSuperFrontEndController().getGeneralization();
559 }
560
561
562 public java.util.Collection getGeneralizationLinks()
563 {
564 return this.getSuperFrontEndController().getGeneralizationLinks();
565 }
566
567
568 public java.lang.String getGeneralizationList()
569 {
570 return this.getSuperFrontEndController().getGeneralizationList();
571 }
572
573
574 public org.andromda.metafacades.uml.GeneralizableElementFacade getGeneralizationRoot()
575 {
576 return this.getSuperFrontEndController().getGeneralizationRoot();
577 }
578
579
580 public java.util.Collection getGeneralizations()
581 {
582 return this.getSuperFrontEndController().getGeneralizations();
583 }
584
585
586 public java.util.Collection getSpecializations()
587 {
588 return this.getSuperFrontEndController().getSpecializations();
589 }
590
591
592 public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
593 {
594 this.getSuperFrontEndController().copyTaggedValues(element);
595 }
596
597
598 public java.lang.Object findTaggedValue(java.lang.String tagName)
599 {
600 return this.getSuperFrontEndController().findTaggedValue(tagName);
601 }
602
603
604 public java.util.Collection findTaggedValues(java.lang.String tagName)
605 {
606 return this.getSuperFrontEndController().findTaggedValues(tagName);
607 }
608
609
610 public java.util.Collection getConstraints(java.lang.String kind)
611 {
612 return this.getSuperFrontEndController().getConstraints(kind);
613 }
614
615
616 public java.util.Collection getConstraints()
617 {
618 return this.getSuperFrontEndController().getConstraints();
619 }
620
621
622 public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
623 {
624 return this.getSuperFrontEndController().getDocumentation(indent, lineLength);
625 }
626
627
628 public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
629 {
630 return this.getSuperFrontEndController().getDocumentation(indent, lineLength, htmlStyle);
631 }
632
633
634 public java.lang.String getDocumentation(java.lang.String indent)
635 {
636 return this.getSuperFrontEndController().getDocumentation(indent);
637 }
638
639
640 public java.lang.String getFullyQualifiedName(boolean modelName)
641 {
642 return this.getSuperFrontEndController().getFullyQualifiedName(modelName);
643 }
644
645
646 public java.lang.String getFullyQualifiedName()
647 {
648 return this.getSuperFrontEndController().getFullyQualifiedName();
649 }
650
651
652 public java.lang.String getFullyQualifiedNamePath()
653 {
654 return this.getSuperFrontEndController().getFullyQualifiedNamePath();
655 }
656
657
658 public java.lang.String getId()
659 {
660 return this.getSuperFrontEndController().getId();
661 }
662
663
664 public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
665 {
666 return this.getSuperFrontEndController().getLanguageMappings();
667 }
668
669
670 public org.andromda.metafacades.uml.ModelFacade getModel()
671 {
672 return this.getSuperFrontEndController().getModel();
673 }
674
675
676 public java.lang.String getName()
677 {
678 return this.getSuperFrontEndController().getName();
679 }
680
681
682 public org.andromda.metafacades.uml.ModelElementFacade getPackage()
683 {
684 return this.getSuperFrontEndController().getPackage();
685 }
686
687
688 public java.lang.String getPackageName()
689 {
690 return this.getSuperFrontEndController().getPackageName();
691 }
692
693
694 public java.lang.String getPackageName(boolean modelName)
695 {
696 return this.getSuperFrontEndController().getPackageName(modelName);
697 }
698
699
700 public java.lang.String getPackagePath()
701 {
702 return this.getSuperFrontEndController().getPackagePath();
703 }
704
705
706 public org.andromda.metafacades.uml.PackageFacade getRootPackage()
707 {
708 return this.getSuperFrontEndController().getRootPackage();
709 }
710
711
712 public java.util.Collection getSourceDependencies()
713 {
714 return this.getSuperFrontEndController().getSourceDependencies();
715 }
716
717
718 public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
719 {
720 return this.getSuperFrontEndController().getStateMachineContext();
721 }
722
723
724 public java.util.Collection getStereotypeNames()
725 {
726 return this.getSuperFrontEndController().getStereotypeNames();
727 }
728
729
730 public java.util.Collection getStereotypes()
731 {
732 return this.getSuperFrontEndController().getStereotypes();
733 }
734
735
736 public java.util.Collection getTaggedValues()
737 {
738 return this.getSuperFrontEndController().getTaggedValues();
739 }
740
741
742 public java.util.Collection getTargetDependencies()
743 {
744 return this.getSuperFrontEndController().getTargetDependencies();
745 }
746
747
748 public java.lang.Object getTemplateParameter(java.lang.String parameterName)
749 {
750 return this.getSuperFrontEndController().getTemplateParameter(parameterName);
751 }
752
753
754 public java.util.Collection getTemplateParameters()
755 {
756 return this.getSuperFrontEndController().getTemplateParameters();
757 }
758
759
760 public java.lang.String getVisibility()
761 {
762 return this.getSuperFrontEndController().getVisibility();
763 }
764
765
766 public boolean hasExactStereotype(java.lang.String stereotypeName)
767 {
768 return this.getSuperFrontEndController().hasExactStereotype(stereotypeName);
769 }
770
771
772 public boolean hasStereotype(java.lang.String stereotypeName)
773 {
774 return this.getSuperFrontEndController().hasStereotype(stereotypeName);
775 }
776
777
778 public boolean isBindingDependenciesPresent()
779 {
780 return this.getSuperFrontEndController().isBindingDependenciesPresent();
781 }
782
783
784 public boolean isConstraintsPresent()
785 {
786 return this.getSuperFrontEndController().isConstraintsPresent();
787 }
788
789
790 public boolean isTemplateParametersPresent()
791 {
792 return this.getSuperFrontEndController().isTemplateParametersPresent();
793 }
794
795
796 public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
797 {
798 return this.getSuperFrontEndController().translateConstraint(name, translation);
799 }
800
801
802 public java.lang.String[] translateConstraints(java.lang.String translation)
803 {
804 return this.getSuperFrontEndController().translateConstraints(translation);
805 }
806
807
808 public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
809 {
810 return this.getSuperFrontEndController().translateConstraints(kind, translation);
811 }
812
813 /***
814 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
815 */
816 public void initialize()
817 {
818 this.getSuperFrontEndController().initialize();
819 }
820
821 /***
822 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
823 */
824 public Object getValidationOwner()
825 {
826 Object owner = this.getSuperFrontEndController().getValidationOwner();
827 return owner;
828 }
829
830 /***
831 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
832 */
833 public String getValidationName()
834 {
835 String name = this.getSuperFrontEndController().getValidationName();
836 return name;
837 }
838
839 /***
840 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
841 */
842 public void validateInvariants(java.util.Collection validationMessages)
843 {
844 this.getSuperFrontEndController().validateInvariants(validationMessages);
845 {
846 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"name")));
847 if (!constraintValid)
848 validationMessages.add(
849 new org.andromda.core.metafacade.ModelValidationMessage(
850 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
851 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller must have a name",
852 "Each controller must have a name, it cannot be empty."));
853 }
854 {
855 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.isUnique(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"operations"),new org.apache.commons.collections.Transformer(){public Object transform(java.lang.Object object){return org.andromda.translation.ocl.validation.OCLIntrospector.invoke(object,"name");}}));
856 if (!constraintValid)
857 validationMessages.add(
858 new org.andromda.core.metafacade.ModelValidationMessage(
859 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
860 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::unique operation names",
861 "A controller cannot have different operations with the same name, even if they have a different signature."));
862 }
863 {
864 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLExpressions.notEqual(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"name"),org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"useCase.activityGraph.firstAction.actionClassName")));
865 if (!constraintValid)
866 validationMessages.add(
867 new org.andromda.core.metafacade.ModelValidationMessage(
868 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
869 "org::andromda::cartridges::bpm4struts::metafacades::StrutsController::controller name should not resemble the usecase name",
870 "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)."));
871 }
872 }
873
874 /***
875 * The property that stores the name of the metafacade.
876 */
877 private static final String NAME_PROPERTY = "name";
878
879 /***
880 * @see java.lang.Object#toString()
881 */
882 public String toString()
883 {
884 final StringBuffer toString = new StringBuffer(this.getClass().getName());
885 toString.append("[");
886 try
887 {
888 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
889 }
890 catch (final Throwable throwable)
891 {
892
893 }
894 toString.append("]");
895 return toString.toString();
896 }
897 }