1
2
3
4 package org.andromda.cartridges.webservice.metafacades;
5
6 /***
7 * MetafacadeLogic for org.andromda.cartridges.webservice.metafacades.WebServiceOperation
8 *
9 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation
10 */
11 public abstract class WebServiceOperationLogic
12 extends org.andromda.core.metafacade.MetafacadeBase
13 implements org.andromda.cartridges.webservice.metafacades.WebServiceOperation
14 {
15
16 protected Object metaObject;
17
18 public WebServiceOperationLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.superServiceOperation =
22 (org.andromda.metafacades.uml.ServiceOperation)
23 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24 "org.andromda.metafacades.uml.ServiceOperation",
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.webservice.metafacades.WebServiceOperation";
38 }
39 return context;
40 }
41
42 private org.andromda.metafacades.uml.ServiceOperation superServiceOperation;
43 private boolean superServiceOperationInitialized = false;
44
45 /***
46 * Gets the org.andromda.metafacades.uml.ServiceOperation parent instance.
47 */
48 private org.andromda.metafacades.uml.ServiceOperation getSuperServiceOperation()
49 {
50 if (!this.superServiceOperationInitialized)
51 {
52 ((org.andromda.core.metafacade.MetafacadeBase)superServiceOperation).setMetafacadeContext(this.getMetafacadeContext());
53 this.superServiceOperationInitialized = true;
54 }
55 return superServiceOperation;
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.superServiceOperationInitialized)
68 {
69 ((org.andromda.core.metafacade.MetafacadeBase)superServiceOperation).resetMetafacadeContext(context);
70 }
71 }
72 }
73
74 /***
75 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation
76 */
77 public boolean isWebServiceOperationMetaType()
78 {
79 return true;
80 }
81
82
83
84 /***
85 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#isExposed()
86 */
87 protected abstract boolean handleIsExposed();
88
89 private void handleIsExposed1aPreCondition()
90 {
91 }
92
93 private void handleIsExposed1aPostCondition()
94 {
95 }
96
97 private boolean __exposed1a;
98 private boolean __exposed1aSet = false;
99
100 public final boolean isExposed()
101 {
102 boolean exposed1a = this.__exposed1a;
103 if (!this.__exposed1aSet)
104 {
105 handleIsExposed1aPreCondition();
106 exposed1a = handleIsExposed();
107 handleIsExposed1aPostCondition();
108 this.__exposed1a = exposed1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__exposed1aSet = true;
112 }
113 }
114 return exposed1a;
115 }
116
117 /***
118 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationName()
119 */
120 protected abstract java.lang.String handleGetTestImplementationName();
121
122 private void handleGetTestImplementationName2aPreCondition()
123 {
124 }
125
126 private void handleGetTestImplementationName2aPostCondition()
127 {
128 }
129
130 private java.lang.String __testImplementationName2a;
131 private boolean __testImplementationName2aSet = false;
132
133 public final java.lang.String getTestImplementationName()
134 {
135 java.lang.String testImplementationName2a = this.__testImplementationName2a;
136 if (!this.__testImplementationName2aSet)
137 {
138 handleGetTestImplementationName2aPreCondition();
139 testImplementationName2a = handleGetTestImplementationName();
140 handleGetTestImplementationName2aPostCondition();
141 this.__testImplementationName2a = testImplementationName2a;
142 if (isMetafacadePropertyCachingEnabled())
143 {
144 this.__testImplementationName2aSet = true;
145 }
146 }
147 return testImplementationName2a;
148 }
149
150 /***
151 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationCall()
152 */
153 protected abstract java.lang.String handleGetTestImplementationCall();
154
155 private void handleGetTestImplementationCall3aPreCondition()
156 {
157 }
158
159 private void handleGetTestImplementationCall3aPostCondition()
160 {
161 }
162
163 private java.lang.String __testImplementationCall3a;
164 private boolean __testImplementationCall3aSet = false;
165
166 public final java.lang.String getTestImplementationCall()
167 {
168 java.lang.String testImplementationCall3a = this.__testImplementationCall3a;
169 if (!this.__testImplementationCall3aSet)
170 {
171 handleGetTestImplementationCall3aPreCondition();
172 testImplementationCall3a = handleGetTestImplementationCall();
173 handleGetTestImplementationCall3aPostCondition();
174 this.__testImplementationCall3a = testImplementationCall3a;
175 if (isMetafacadePropertyCachingEnabled())
176 {
177 this.__testImplementationCall3aSet = true;
178 }
179 }
180 return testImplementationCall3a;
181 }
182
183 /***
184 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestImplementationSignature()
185 */
186 protected abstract java.lang.String handleGetTestImplementationSignature();
187
188 private void handleGetTestImplementationSignature4aPreCondition()
189 {
190 }
191
192 private void handleGetTestImplementationSignature4aPostCondition()
193 {
194 }
195
196 private java.lang.String __testImplementationSignature4a;
197 private boolean __testImplementationSignature4aSet = false;
198
199 public final java.lang.String getTestImplementationSignature()
200 {
201 java.lang.String testImplementationSignature4a = this.__testImplementationSignature4a;
202 if (!this.__testImplementationSignature4aSet)
203 {
204 handleGetTestImplementationSignature4aPreCondition();
205 testImplementationSignature4a = handleGetTestImplementationSignature();
206 handleGetTestImplementationSignature4aPostCondition();
207 this.__testImplementationSignature4a = testImplementationSignature4a;
208 if (isMetafacadePropertyCachingEnabled())
209 {
210 this.__testImplementationSignature4aSet = true;
211 }
212 }
213 return testImplementationSignature4a;
214 }
215
216 /***
217 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestName()
218 */
219 protected abstract java.lang.String handleGetTestName();
220
221 private void handleGetTestName5aPreCondition()
222 {
223 }
224
225 private void handleGetTestName5aPostCondition()
226 {
227 }
228
229 private java.lang.String __testName5a;
230 private boolean __testName5aSet = false;
231
232 public final java.lang.String getTestName()
233 {
234 java.lang.String testName5a = this.__testName5a;
235 if (!this.__testName5aSet)
236 {
237 handleGetTestName5aPreCondition();
238 testName5a = handleGetTestName();
239 handleGetTestName5aPostCondition();
240 this.__testName5a = testName5a;
241 if (isMetafacadePropertyCachingEnabled())
242 {
243 this.__testName5aSet = true;
244 }
245 }
246 return testName5a;
247 }
248
249 /***
250 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestCall()
251 */
252 protected abstract java.lang.String handleGetTestCall();
253
254 private void handleGetTestCall6aPreCondition()
255 {
256 }
257
258 private void handleGetTestCall6aPostCondition()
259 {
260 }
261
262 private java.lang.String __testCall6a;
263 private boolean __testCall6aSet = false;
264
265 public final java.lang.String getTestCall()
266 {
267 java.lang.String testCall6a = this.__testCall6a;
268 if (!this.__testCall6aSet)
269 {
270 handleGetTestCall6aPreCondition();
271 testCall6a = handleGetTestCall();
272 handleGetTestCall6aPostCondition();
273 this.__testCall6a = testCall6a;
274 if (isMetafacadePropertyCachingEnabled())
275 {
276 this.__testCall6aSet = true;
277 }
278 }
279 return testCall6a;
280 }
281
282 /***
283 * @see org.andromda.cartridges.webservice.metafacades.WebServiceOperation#getTestSignature()
284 */
285 protected abstract java.lang.String handleGetTestSignature();
286
287 private void handleGetTestSignature7aPreCondition()
288 {
289 }
290
291 private void handleGetTestSignature7aPostCondition()
292 {
293 }
294
295 private java.lang.String __testSignature7a;
296 private boolean __testSignature7aSet = false;
297
298 public final java.lang.String getTestSignature()
299 {
300 java.lang.String testSignature7a = this.__testSignature7a;
301 if (!this.__testSignature7aSet)
302 {
303 handleGetTestSignature7aPreCondition();
304 testSignature7a = handleGetTestSignature();
305 handleGetTestSignature7aPostCondition();
306 this.__testSignature7a = testSignature7a;
307 if (isMetafacadePropertyCachingEnabled())
308 {
309 this.__testSignature7aSet = true;
310 }
311 }
312 return testSignature7a;
313 }
314
315
316
317 /***
318 * @see org.andromda.metafacades.uml.ServiceOperation
319 */
320 public boolean isServiceOperationMetaType()
321 {
322 return true;
323 }
324
325 /***
326 * @see org.andromda.metafacades.uml.OperationFacade
327 */
328 public boolean isOperationFacadeMetaType()
329 {
330 return true;
331 }
332
333 /***
334 * @see org.andromda.metafacades.uml.ModelElementFacade
335 */
336 public boolean isModelElementFacadeMetaType()
337 {
338 return true;
339 }
340
341
342
343 public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
344 {
345 this.getSuperServiceOperation().copyTaggedValues(element);
346 }
347
348
349 public java.lang.Object findTaggedValue(java.lang.String tagName)
350 {
351 return this.getSuperServiceOperation().findTaggedValue(tagName);
352 }
353
354
355 public java.util.Collection findTaggedValues(java.lang.String tagName)
356 {
357 return this.getSuperServiceOperation().findTaggedValues(tagName);
358 }
359
360
361 public java.util.Collection getConstraints()
362 {
363 return this.getSuperServiceOperation().getConstraints();
364 }
365
366
367 public java.util.Collection getConstraints(java.lang.String kind)
368 {
369 return this.getSuperServiceOperation().getConstraints(kind);
370 }
371
372
373 public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
374 {
375 return this.getSuperServiceOperation().getDocumentation(indent, lineLength);
376 }
377
378
379 public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
380 {
381 return this.getSuperServiceOperation().getDocumentation(indent, lineLength, htmlStyle);
382 }
383
384
385 public java.lang.String getDocumentation(java.lang.String indent)
386 {
387 return this.getSuperServiceOperation().getDocumentation(indent);
388 }
389
390
391 public java.lang.String getFullyQualifiedName(boolean modelName)
392 {
393 return this.getSuperServiceOperation().getFullyQualifiedName(modelName);
394 }
395
396
397 public java.lang.String getFullyQualifiedName()
398 {
399 return this.getSuperServiceOperation().getFullyQualifiedName();
400 }
401
402
403 public java.lang.String getFullyQualifiedNamePath()
404 {
405 return this.getSuperServiceOperation().getFullyQualifiedNamePath();
406 }
407
408
409 public java.lang.String getId()
410 {
411 return this.getSuperServiceOperation().getId();
412 }
413
414
415 public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
416 {
417 return this.getSuperServiceOperation().getLanguageMappings();
418 }
419
420
421 public org.andromda.metafacades.uml.ModelFacade getModel()
422 {
423 return this.getSuperServiceOperation().getModel();
424 }
425
426
427 public java.lang.String getName()
428 {
429 return this.getSuperServiceOperation().getName();
430 }
431
432
433 public org.andromda.metafacades.uml.ModelElementFacade getPackage()
434 {
435 return this.getSuperServiceOperation().getPackage();
436 }
437
438
439 public java.lang.String getPackageName(boolean modelName)
440 {
441 return this.getSuperServiceOperation().getPackageName(modelName);
442 }
443
444
445 public java.lang.String getPackageName()
446 {
447 return this.getSuperServiceOperation().getPackageName();
448 }
449
450
451 public java.lang.String getPackagePath()
452 {
453 return this.getSuperServiceOperation().getPackagePath();
454 }
455
456
457 public org.andromda.metafacades.uml.PackageFacade getRootPackage()
458 {
459 return this.getSuperServiceOperation().getRootPackage();
460 }
461
462
463 public java.util.Collection getSourceDependencies()
464 {
465 return this.getSuperServiceOperation().getSourceDependencies();
466 }
467
468
469 public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
470 {
471 return this.getSuperServiceOperation().getStateMachineContext();
472 }
473
474
475 public java.util.Collection getStereotypeNames()
476 {
477 return this.getSuperServiceOperation().getStereotypeNames();
478 }
479
480
481 public java.util.Collection getStereotypes()
482 {
483 return this.getSuperServiceOperation().getStereotypes();
484 }
485
486
487 public java.util.Collection getTaggedValues()
488 {
489 return this.getSuperServiceOperation().getTaggedValues();
490 }
491
492
493 public java.util.Collection getTargetDependencies()
494 {
495 return this.getSuperServiceOperation().getTargetDependencies();
496 }
497
498
499 public java.lang.Object getTemplateParameter(java.lang.String parameterName)
500 {
501 return this.getSuperServiceOperation().getTemplateParameter(parameterName);
502 }
503
504
505 public java.util.Collection getTemplateParameters()
506 {
507 return this.getSuperServiceOperation().getTemplateParameters();
508 }
509
510
511 public java.lang.String getVisibility()
512 {
513 return this.getSuperServiceOperation().getVisibility();
514 }
515
516
517 public boolean hasExactStereotype(java.lang.String stereotypeName)
518 {
519 return this.getSuperServiceOperation().hasExactStereotype(stereotypeName);
520 }
521
522
523 public boolean hasStereotype(java.lang.String stereotypeName)
524 {
525 return this.getSuperServiceOperation().hasStereotype(stereotypeName);
526 }
527
528
529 public boolean isBindingDependenciesPresent()
530 {
531 return this.getSuperServiceOperation().isBindingDependenciesPresent();
532 }
533
534
535 public boolean isConstraintsPresent()
536 {
537 return this.getSuperServiceOperation().isConstraintsPresent();
538 }
539
540
541 public boolean isTemplateParametersPresent()
542 {
543 return this.getSuperServiceOperation().isTemplateParametersPresent();
544 }
545
546
547 public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
548 {
549 return this.getSuperServiceOperation().translateConstraint(name, translation);
550 }
551
552
553 public java.lang.String[] translateConstraints(java.lang.String translation)
554 {
555 return this.getSuperServiceOperation().translateConstraints(translation);
556 }
557
558
559 public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
560 {
561 return this.getSuperServiceOperation().translateConstraints(kind, translation);
562 }
563
564
565 public org.andromda.metafacades.uml.ParameterFacade findParameter(java.lang.String name)
566 {
567 return this.getSuperServiceOperation().findParameter(name);
568 }
569
570
571 public java.lang.Object findTaggedValue(java.lang.String name, boolean follow)
572 {
573 return this.getSuperServiceOperation().findTaggedValue(name, follow);
574 }
575
576
577 public java.lang.String getArgumentNames()
578 {
579 return this.getSuperServiceOperation().getArgumentNames();
580 }
581
582
583 public java.lang.String getArgumentTypeNames()
584 {
585 return this.getSuperServiceOperation().getArgumentTypeNames();
586 }
587
588
589 public java.util.Collection getArguments()
590 {
591 return this.getSuperServiceOperation().getArguments();
592 }
593
594
595 public java.lang.String getCall()
596 {
597 return this.getSuperServiceOperation().getCall();
598 }
599
600
601 public java.lang.String getConcurrency()
602 {
603 return this.getSuperServiceOperation().getConcurrency();
604 }
605
606
607 public java.lang.String getExceptionList(java.lang.String initialExceptions)
608 {
609 return this.getSuperServiceOperation().getExceptionList(initialExceptions);
610 }
611
612
613 public java.lang.String getExceptionList()
614 {
615 return this.getSuperServiceOperation().getExceptionList();
616 }
617
618
619 public java.util.Collection getExceptions()
620 {
621 return this.getSuperServiceOperation().getExceptions();
622 }
623
624
625 public int getLower()
626 {
627 return this.getSuperServiceOperation().getLower();
628 }
629
630
631 public org.andromda.metafacades.uml.OperationFacade getOverriddenOperation()
632 {
633 return this.getSuperServiceOperation().getOverriddenOperation();
634 }
635
636
637 public org.andromda.metafacades.uml.ClassifierFacade getOwner()
638 {
639 return this.getSuperServiceOperation().getOwner();
640 }
641
642
643 public java.util.Collection getParameters()
644 {
645 return this.getSuperServiceOperation().getParameters();
646 }
647
648
649 public java.lang.String getPostconditionName()
650 {
651 return this.getSuperServiceOperation().getPostconditionName();
652 }
653
654
655 public java.util.Collection getPostconditions()
656 {
657 return this.getSuperServiceOperation().getPostconditions();
658 }
659
660
661 public java.lang.String getPreconditionCall()
662 {
663 return this.getSuperServiceOperation().getPreconditionCall();
664 }
665
666
667 public java.lang.String getPreconditionName()
668 {
669 return this.getSuperServiceOperation().getPreconditionName();
670 }
671
672
673 public java.lang.String getPreconditionSignature()
674 {
675 return this.getSuperServiceOperation().getPreconditionSignature();
676 }
677
678
679 public java.util.Collection getPreconditions()
680 {
681 return this.getSuperServiceOperation().getPreconditions();
682 }
683
684
685 public org.andromda.metafacades.uml.ParameterFacade getReturnParameter()
686 {
687 return this.getSuperServiceOperation().getReturnParameter();
688 }
689
690
691 public org.andromda.metafacades.uml.ClassifierFacade getReturnType()
692 {
693 return this.getSuperServiceOperation().getReturnType();
694 }
695
696
697 public java.lang.String getSignature(boolean withArgumentNames)
698 {
699 return this.getSuperServiceOperation().getSignature(withArgumentNames);
700 }
701
702
703 public java.lang.String getSignature()
704 {
705 return this.getSuperServiceOperation().getSignature();
706 }
707
708
709 public java.lang.String getSignature(java.lang.String argumentModifier)
710 {
711 return this.getSuperServiceOperation().getSignature(argumentModifier);
712 }
713
714
715 public java.lang.String getTypedArgumentList(java.lang.String modifier)
716 {
717 return this.getSuperServiceOperation().getTypedArgumentList(modifier);
718 }
719
720
721 public java.lang.String getTypedArgumentList()
722 {
723 return this.getSuperServiceOperation().getTypedArgumentList();
724 }
725
726
727 public int getUpper()
728 {
729 return this.getSuperServiceOperation().getUpper();
730 }
731
732
733 public boolean isAbstract()
734 {
735 return this.getSuperServiceOperation().isAbstract();
736 }
737
738
739 public boolean isExceptionsPresent()
740 {
741 return this.getSuperServiceOperation().isExceptionsPresent();
742 }
743
744
745 public boolean isOverriding()
746 {
747 return this.getSuperServiceOperation().isOverriding();
748 }
749
750
751 public boolean isPostconditionsPresent()
752 {
753 return this.getSuperServiceOperation().isPostconditionsPresent();
754 }
755
756
757 public boolean isPreconditionsPresent()
758 {
759 return this.getSuperServiceOperation().isPreconditionsPresent();
760 }
761
762
763 public boolean isQuery()
764 {
765 return this.getSuperServiceOperation().isQuery();
766 }
767
768
769 public boolean isReturnTypePresent()
770 {
771 return this.getSuperServiceOperation().isReturnTypePresent();
772 }
773
774
775 public boolean isStatic()
776 {
777 return this.getSuperServiceOperation().isStatic();
778 }
779
780
781 public java.util.Collection getRoles()
782 {
783 return this.getSuperServiceOperation().getRoles();
784 }
785
786
787 public org.andromda.metafacades.uml.Service getService()
788 {
789 return this.getSuperServiceOperation().getService();
790 }
791
792 /***
793 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
794 */
795 public void initialize()
796 {
797 this.getSuperServiceOperation().initialize();
798 }
799
800 /***
801 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
802 */
803 public Object getValidationOwner()
804 {
805 Object owner = this.getSuperServiceOperation().getValidationOwner();
806 return owner;
807 }
808
809 /***
810 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
811 */
812 public String getValidationName()
813 {
814 String name = this.getSuperServiceOperation().getValidationName();
815 return name;
816 }
817
818 /***
819 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
820 */
821 public void validateInvariants(java.util.Collection validationMessages)
822 {
823 this.getSuperServiceOperation().validateInvariants(validationMessages);
824 {
825 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"exposed"))).booleanValue()?org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"returnType.collectionType"),false):true));
826 if (!constraintValid)
827 validationMessages.add(
828 new org.andromda.core.metafacade.ModelValidationMessage(
829 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
830 "org::andromda::cartridges::webservice::metafacades::WebServiceOperation::a web service operation return type can not be a collection type",
831 "A web service operation's return type can NOT be a collection type, you'll need to model an array instead."));
832 }
833 }
834
835 /***
836 * The property that stores the name of the metafacade.
837 */
838 private static final String NAME_PROPERTY = "name";
839
840 /***
841 * @see java.lang.Object#toString()
842 */
843 public String toString()
844 {
845 final StringBuffer toString = new StringBuffer(this.getClass().getName());
846 toString.append("[");
847 try
848 {
849 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
850 }
851 catch (final Throwable throwable)
852 {
853
854 }
855 toString.append("]");
856 return toString.toString();
857 }
858 }