1
2
3
4
5 package org.andromda.cartridges.jbpm.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.andromda.metafacades.uml.ModelFacade;
17 import org.andromda.metafacades.uml.OperationFacade;
18 import org.andromda.metafacades.uml.PackageFacade;
19 import org.andromda.metafacades.uml.ParameterFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25
26
27
28
29
30
31
32 public abstract class JBpmHandlerLogic
33 extends MetafacadeBase
34 implements JBpmHandler
35 {
36
37
38
39
40 protected Object metaObject;
41
42
43
44
45
46 protected JBpmHandlerLogic(Object metaObjectIn, String context)
47 {
48 super(metaObjectIn, getContext(context));
49 this.superOperationFacade =
50 (OperationFacade)
51 MetafacadeFactory.getInstance().createFacadeImpl(
52 "org.andromda.metafacades.uml.OperationFacade",
53 metaObjectIn,
54 getContext(context));
55 this.metaObject = metaObjectIn;
56 }
57
58
59
60
61
62
63 private static String getContext(String context)
64 {
65 if (context == null)
66 {
67 context = "org.andromda.cartridges.jbpm.metafacades.JBpmHandler";
68 }
69 return context;
70 }
71
72 private OperationFacade superOperationFacade;
73 private boolean superOperationFacadeInitialized = false;
74
75
76
77
78
79 private OperationFacade getSuperOperationFacade()
80 {
81 if (!this.superOperationFacadeInitialized)
82 {
83 ((MetafacadeBase)this.superOperationFacade).setMetafacadeContext(this.getMetafacadeContext());
84 this.superOperationFacadeInitialized = true;
85 }
86 return this.superOperationFacade;
87 }
88
89
90
91
92
93 @Override
94 public void resetMetafacadeContext(String context)
95 {
96 if (!this.contextRoot)
97 {
98 context = getContext(context);
99 setMetafacadeContext (context);
100 if (this.superOperationFacadeInitialized)
101 {
102 ((MetafacadeBase)this.superOperationFacade).resetMetafacadeContext(context);
103 }
104 }
105 }
106
107
108
109
110
111 public boolean isJBpmHandlerMetaType()
112 {
113 return true;
114 }
115
116
117
118
119
120
121
122 protected abstract boolean handleIsAssignmentHandler();
123
124 private boolean __assignmentHandler1a;
125 private boolean __assignmentHandler1aSet = false;
126
127
128
129
130
131
132 public final boolean isAssignmentHandler()
133 {
134 boolean assignmentHandler1a = this.__assignmentHandler1a;
135 if (!this.__assignmentHandler1aSet)
136 {
137
138 assignmentHandler1a = handleIsAssignmentHandler();
139
140 this.__assignmentHandler1a = assignmentHandler1a;
141 if (isMetafacadePropertyCachingEnabled())
142 {
143 this.__assignmentHandler1aSet = true;
144 }
145 }
146 return assignmentHandler1a;
147 }
148
149
150
151
152
153 protected abstract boolean handleIsActionHandler();
154
155 private boolean __actionHandler2a;
156 private boolean __actionHandler2aSet = false;
157
158
159
160
161
162
163 public final boolean isActionHandler()
164 {
165 boolean actionHandler2a = this.__actionHandler2a;
166 if (!this.__actionHandler2aSet)
167 {
168
169 actionHandler2a = handleIsActionHandler();
170
171 this.__actionHandler2a = actionHandler2a;
172 if (isMetafacadePropertyCachingEnabled())
173 {
174 this.__actionHandler2aSet = true;
175 }
176 }
177 return actionHandler2a;
178 }
179
180
181
182
183
184 protected abstract boolean handleIsContainedInBusinessProcess();
185
186 private boolean __containedInBusinessProcess3a;
187 private boolean __containedInBusinessProcess3aSet = false;
188
189
190
191
192
193 public final boolean isContainedInBusinessProcess()
194 {
195 boolean containedInBusinessProcess3a = this.__containedInBusinessProcess3a;
196 if (!this.__containedInBusinessProcess3aSet)
197 {
198
199 containedInBusinessProcess3a = handleIsContainedInBusinessProcess();
200
201 this.__containedInBusinessProcess3a = containedInBusinessProcess3a;
202 if (isMetafacadePropertyCachingEnabled())
203 {
204 this.__containedInBusinessProcess3aSet = true;
205 }
206 }
207 return containedInBusinessProcess3a;
208 }
209
210
211
212
213
214 protected abstract String handleGetHandlerPackageName();
215
216 private String __handlerPackageName4a;
217 private boolean __handlerPackageName4aSet = false;
218
219
220
221
222
223
224 public final String getHandlerPackageName()
225 {
226 String handlerPackageName4a = this.__handlerPackageName4a;
227 if (!this.__handlerPackageName4aSet)
228 {
229
230 handlerPackageName4a = handleGetHandlerPackageName();
231
232 this.__handlerPackageName4a = handlerPackageName4a;
233 if (isMetafacadePropertyCachingEnabled())
234 {
235 this.__handlerPackageName4aSet = true;
236 }
237 }
238 return handlerPackageName4a;
239 }
240
241
242
243
244
245 protected abstract String handleGetHandlerFullPath();
246
247 private String __handlerFullPath5a;
248 private boolean __handlerFullPath5aSet = false;
249
250
251
252
253
254
255 public final String getHandlerFullPath()
256 {
257 String handlerFullPath5a = this.__handlerFullPath5a;
258 if (!this.__handlerFullPath5aSet)
259 {
260
261 handlerFullPath5a = handleGetHandlerFullPath();
262
263 this.__handlerFullPath5a = handlerFullPath5a;
264 if (isMetafacadePropertyCachingEnabled())
265 {
266 this.__handlerFullPath5aSet = true;
267 }
268 }
269 return handlerFullPath5a;
270 }
271
272
273
274
275
276 protected abstract String handleGetHandlerClassName();
277
278 private String __handlerClassName6a;
279 private boolean __handlerClassName6aSet = false;
280
281
282
283
284
285
286 public final String getHandlerClassName()
287 {
288 String handlerClassName6a = this.__handlerClassName6a;
289 if (!this.__handlerClassName6aSet)
290 {
291
292 handlerClassName6a = handleGetHandlerClassName();
293
294 this.__handlerClassName6a = handlerClassName6a;
295 if (isMetafacadePropertyCachingEnabled())
296 {
297 this.__handlerClassName6aSet = true;
298 }
299 }
300 return handlerClassName6a;
301 }
302
303
304
305
306
307 protected abstract String handleGetClazz();
308
309 private String __clazz7a;
310 private boolean __clazz7aSet = false;
311
312
313
314
315
316 public final String getClazz()
317 {
318 String clazz7a = this.__clazz7a;
319 if (!this.__clazz7aSet)
320 {
321
322 clazz7a = handleGetClazz();
323
324 this.__clazz7a = clazz7a;
325 if (isMetafacadePropertyCachingEnabled())
326 {
327 this.__clazz7aSet = true;
328 }
329 }
330 return clazz7a;
331 }
332
333
334
335
336
337 public boolean isOperationFacadeMetaType()
338 {
339 return true;
340 }
341
342
343
344
345
346 public boolean isModelElementFacadeMetaType()
347 {
348 return true;
349 }
350
351
352
353
354
355
356 public void copyTaggedValues(ModelElementFacade element)
357 {
358 this.getSuperOperationFacade().copyTaggedValues(element);
359 }
360
361
362
363
364
365
366 public Object findTaggedValue(String tagName)
367 {
368 return this.getSuperOperationFacade().findTaggedValue(tagName);
369 }
370
371
372
373
374
375
376 public Collection<Object> findTaggedValues(String tagName)
377 {
378 return this.getSuperOperationFacade().findTaggedValues(tagName);
379 }
380
381
382
383
384
385
386
387 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
388 {
389 return this.getSuperOperationFacade().getBindedFullyQualifiedName(bindedElement);
390 }
391
392
393
394
395
396 public Collection<ConstraintFacade> getConstraints()
397 {
398 return this.getSuperOperationFacade().getConstraints();
399 }
400
401
402
403
404
405
406 public Collection<ConstraintFacade> getConstraints(String kind)
407 {
408 return this.getSuperOperationFacade().getConstraints(kind);
409 }
410
411
412
413
414
415
416
417 public String getDocumentation(String indent)
418 {
419 return this.getSuperOperationFacade().getDocumentation(indent);
420 }
421
422
423
424
425
426
427
428
429 public String getDocumentation(String indent, int lineLength)
430 {
431 return this.getSuperOperationFacade().getDocumentation(indent, lineLength);
432 }
433
434
435
436
437
438
439
440 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
441 {
442 return this.getSuperOperationFacade().getDocumentation(indent, lineLength, htmlStyle);
443 }
444
445
446
447
448
449 public String getFullyQualifiedName()
450 {
451 return this.getSuperOperationFacade().getFullyQualifiedName();
452 }
453
454
455
456
457
458
459
460
461 public String getFullyQualifiedName(boolean modelName)
462 {
463 return this.getSuperOperationFacade().getFullyQualifiedName(modelName);
464 }
465
466
467
468
469
470
471 public String getFullyQualifiedNamePath()
472 {
473 return this.getSuperOperationFacade().getFullyQualifiedNamePath();
474 }
475
476
477
478
479
480 public String getId()
481 {
482 return this.getSuperOperationFacade().getId();
483 }
484
485
486
487
488
489
490
491
492
493 public Collection<String> getKeywords()
494 {
495 return this.getSuperOperationFacade().getKeywords();
496 }
497
498
499
500
501
502 public String getLabel()
503 {
504 return this.getSuperOperationFacade().getLabel();
505 }
506
507
508
509
510
511 public TypeMappings getLanguageMappings()
512 {
513 return this.getSuperOperationFacade().getLanguageMappings();
514 }
515
516
517
518
519
520
521 public ModelFacade getModel()
522 {
523 return this.getSuperOperationFacade().getModel();
524 }
525
526
527
528
529
530 public String getName()
531 {
532 return this.getSuperOperationFacade().getName();
533 }
534
535
536
537
538
539 public ModelElementFacade getPackage()
540 {
541 return this.getSuperOperationFacade().getPackage();
542 }
543
544
545
546
547
548 public String getPackageName()
549 {
550 return this.getSuperOperationFacade().getPackageName();
551 }
552
553
554
555
556
557
558 public String getPackageName(boolean modelName)
559 {
560 return this.getSuperOperationFacade().getPackageName(modelName);
561 }
562
563
564
565
566
567 public String getPackagePath()
568 {
569 return this.getSuperOperationFacade().getPackagePath();
570 }
571
572
573
574
575
576
577
578
579 public String getQualifiedName()
580 {
581 return this.getSuperOperationFacade().getQualifiedName();
582 }
583
584
585
586
587
588 public PackageFacade getRootPackage()
589 {
590 return this.getSuperOperationFacade().getRootPackage();
591 }
592
593
594
595
596
597 public Collection<DependencyFacade> getSourceDependencies()
598 {
599 return this.getSuperOperationFacade().getSourceDependencies();
600 }
601
602
603
604
605
606
607 public StateMachineFacade getStateMachineContext()
608 {
609 return this.getSuperOperationFacade().getStateMachineContext();
610 }
611
612
613
614
615
616 public Collection<String> getStereotypeNames()
617 {
618 return this.getSuperOperationFacade().getStereotypeNames();
619 }
620
621
622
623
624
625 public Collection<StereotypeFacade> getStereotypes()
626 {
627 return this.getSuperOperationFacade().getStereotypes();
628 }
629
630
631
632
633
634 public Collection<TaggedValueFacade> getTaggedValues()
635 {
636 return this.getSuperOperationFacade().getTaggedValues();
637 }
638
639
640
641
642
643 public Collection<DependencyFacade> getTargetDependencies()
644 {
645 return this.getSuperOperationFacade().getTargetDependencies();
646 }
647
648
649
650
651
652 public Object getTemplateParameter(String parameterName)
653 {
654 return this.getSuperOperationFacade().getTemplateParameter(parameterName);
655 }
656
657
658
659
660
661 public Collection<TemplateParameterFacade> getTemplateParameters()
662 {
663 return this.getSuperOperationFacade().getTemplateParameters();
664 }
665
666
667
668
669
670
671 public String getVisibility()
672 {
673 return this.getSuperOperationFacade().getVisibility();
674 }
675
676
677
678
679
680
681 public boolean hasExactStereotype(String stereotypeName)
682 {
683 return this.getSuperOperationFacade().hasExactStereotype(stereotypeName);
684 }
685
686
687
688
689
690
691 public boolean hasKeyword(String keywordName)
692 {
693 return this.getSuperOperationFacade().hasKeyword(keywordName);
694 }
695
696
697
698
699
700
701
702
703
704
705
706
707
708 public boolean hasStereotype(String stereotypeName)
709 {
710 return this.getSuperOperationFacade().hasStereotype(stereotypeName);
711 }
712
713
714
715
716
717
718 public boolean isBindingDependenciesPresent()
719 {
720 return this.getSuperOperationFacade().isBindingDependenciesPresent();
721 }
722
723
724
725
726
727 public boolean isConstraintsPresent()
728 {
729 return this.getSuperOperationFacade().isConstraintsPresent();
730 }
731
732
733
734
735
736 public boolean isDocumentationPresent()
737 {
738 return this.getSuperOperationFacade().isDocumentationPresent();
739 }
740
741
742
743
744
745 public boolean isReservedWord()
746 {
747 return this.getSuperOperationFacade().isReservedWord();
748 }
749
750
751
752
753
754
755 public boolean isTemplateParametersPresent()
756 {
757 return this.getSuperOperationFacade().isTemplateParametersPresent();
758 }
759
760
761
762
763
764
765
766 public boolean isValidIdentifierName()
767 {
768 return this.getSuperOperationFacade().isValidIdentifierName();
769 }
770
771
772
773
774
775
776
777 public String translateConstraint(String name, String translation)
778 {
779 return this.getSuperOperationFacade().translateConstraint(name, translation);
780 }
781
782
783
784
785
786 public String[] translateConstraints(String translation)
787 {
788 return this.getSuperOperationFacade().translateConstraints(translation);
789 }
790
791
792
793
794
795 public String[] translateConstraints(String kind, String translation)
796 {
797 return this.getSuperOperationFacade().translateConstraints(kind, translation);
798 }
799
800
801
802
803
804
805 public ParameterFacade findParameter(String name)
806 {
807 return this.getSuperOperationFacade().findParameter(name);
808 }
809
810
811
812
813
814
815
816 public Object findTaggedValue(String name, boolean follow)
817 {
818 return this.getSuperOperationFacade().findTaggedValue(name, follow);
819 }
820
821
822
823
824
825 public String getArgumentNames()
826 {
827 return this.getSuperOperationFacade().getArgumentNames();
828 }
829
830
831
832
833
834 public String getArgumentTypeNames()
835 {
836 return this.getSuperOperationFacade().getArgumentTypeNames();
837 }
838
839
840
841
842
843
844
845
846
847 public Collection<ParameterFacade> getArguments()
848 {
849 return this.getSuperOperationFacade().getArguments();
850 }
851
852
853
854
855
856 public String getCall()
857 {
858 return this.getSuperOperationFacade().getCall();
859 }
860
861
862
863
864
865
866
867 public String getConcurrency()
868 {
869 return this.getSuperOperationFacade().getConcurrency();
870 }
871
872
873
874
875
876
877 public String getExceptionList()
878 {
879 return this.getSuperOperationFacade().getExceptionList();
880 }
881
882
883
884
885
886
887 public String getExceptionList(String initialExceptions)
888 {
889 return this.getSuperOperationFacade().getExceptionList(initialExceptions);
890 }
891
892
893
894
895
896 public Collection<ModelElementFacade> getExceptions()
897 {
898 return this.getSuperOperationFacade().getExceptions();
899 }
900
901
902
903
904
905 public String getGetterSetterReturnTypeName()
906 {
907 return this.getSuperOperationFacade().getGetterSetterReturnTypeName();
908 }
909
910
911
912
913
914
915 public int getLower()
916 {
917 return this.getSuperOperationFacade().getLower();
918 }
919
920
921
922
923
924 public String getMethodBody()
925 {
926 return this.getSuperOperationFacade().getMethodBody();
927 }
928
929
930
931
932
933 public OperationFacade getOverriddenOperation()
934 {
935 return this.getSuperOperationFacade().getOverriddenOperation();
936 }
937
938
939
940
941
942 public ClassifierFacade getOwner()
943 {
944 return this.getSuperOperationFacade().getOwner();
945 }
946
947
948
949
950
951 public Collection<ParameterFacade> getParameters()
952 {
953 return this.getSuperOperationFacade().getParameters();
954 }
955
956
957
958
959
960 public String getPostconditionName()
961 {
962 return this.getSuperOperationFacade().getPostconditionName();
963 }
964
965
966
967
968
969 public Collection<ConstraintFacade> getPostconditions()
970 {
971 return this.getSuperOperationFacade().getPostconditions();
972 }
973
974
975
976
977
978 public String getPreconditionCall()
979 {
980 return this.getSuperOperationFacade().getPreconditionCall();
981 }
982
983
984
985
986
987 public String getPreconditionName()
988 {
989 return this.getSuperOperationFacade().getPreconditionName();
990 }
991
992
993
994
995
996 public String getPreconditionSignature()
997 {
998 return this.getSuperOperationFacade().getPreconditionSignature();
999 }
1000
1001
1002
1003
1004
1005 public Collection<ConstraintFacade> getPreconditions()
1006 {
1007 return this.getSuperOperationFacade().getPreconditions();
1008 }
1009
1010
1011
1012
1013
1014 public ParameterFacade getReturnParameter()
1015 {
1016 return this.getSuperOperationFacade().getReturnParameter();
1017 }
1018
1019
1020
1021
1022
1023 public ClassifierFacade getReturnType()
1024 {
1025 return this.getSuperOperationFacade().getReturnType();
1026 }
1027
1028
1029
1030
1031
1032
1033 public String getSignature()
1034 {
1035 return this.getSuperOperationFacade().getSignature();
1036 }
1037
1038
1039
1040
1041
1042
1043
1044 public String getSignature(boolean withArgumentNames)
1045 {
1046 return this.getSuperOperationFacade().getSignature(withArgumentNames);
1047 }
1048
1049
1050
1051
1052
1053
1054 public String getSignature(String argumentModifier)
1055 {
1056 return this.getSuperOperationFacade().getSignature(argumentModifier);
1057 }
1058
1059
1060
1061
1062
1063 public String getTypedArgumentList()
1064 {
1065 return this.getSuperOperationFacade().getTypedArgumentList();
1066 }
1067
1068
1069
1070
1071
1072
1073 public String getTypedArgumentList(String modifier)
1074 {
1075 return this.getSuperOperationFacade().getTypedArgumentList(modifier);
1076 }
1077
1078
1079
1080
1081
1082
1083 public int getUpper()
1084 {
1085 return this.getSuperOperationFacade().getUpper();
1086 }
1087
1088
1089
1090
1091
1092 public boolean isAbstract()
1093 {
1094 return this.getSuperOperationFacade().isAbstract();
1095 }
1096
1097
1098
1099
1100
1101 public boolean isExceptionsPresent()
1102 {
1103 return this.getSuperOperationFacade().isExceptionsPresent();
1104 }
1105
1106
1107
1108
1109
1110
1111 public boolean isLeaf()
1112 {
1113 return this.getSuperOperationFacade().isLeaf();
1114 }
1115
1116
1117
1118
1119
1120
1121 public boolean isMany()
1122 {
1123 return this.getSuperOperationFacade().isMany();
1124 }
1125
1126
1127
1128
1129
1130
1131 public boolean isOrdered()
1132 {
1133 return this.getSuperOperationFacade().isOrdered();
1134 }
1135
1136
1137
1138
1139
1140
1141
1142 public boolean isOverriding()
1143 {
1144 return this.getSuperOperationFacade().isOverriding();
1145 }
1146
1147
1148
1149
1150
1151 public boolean isPostconditionsPresent()
1152 {
1153 return this.getSuperOperationFacade().isPostconditionsPresent();
1154 }
1155
1156
1157
1158
1159
1160 public boolean isPreconditionsPresent()
1161 {
1162 return this.getSuperOperationFacade().isPreconditionsPresent();
1163 }
1164
1165
1166
1167
1168
1169 public boolean isQuery()
1170 {
1171 return this.getSuperOperationFacade().isQuery();
1172 }
1173
1174
1175
1176
1177
1178
1179 public boolean isReturnTypePresent()
1180 {
1181 return this.getSuperOperationFacade().isReturnTypePresent();
1182 }
1183
1184
1185
1186
1187
1188 public boolean isStatic()
1189 {
1190 return this.getSuperOperationFacade().isStatic();
1191 }
1192
1193
1194
1195
1196
1197
1198 public boolean isUnique()
1199 {
1200 return this.getSuperOperationFacade().isUnique();
1201 }
1202
1203
1204
1205
1206 @Override
1207 public void initialize()
1208 {
1209 this.getSuperOperationFacade().initialize();
1210 }
1211
1212
1213
1214
1215
1216 @Override
1217 public Object getValidationOwner()
1218 {
1219 Object owner = this.getSuperOperationFacade().getValidationOwner();
1220 return owner;
1221 }
1222
1223
1224
1225
1226
1227 @Override
1228 public String getValidationName()
1229 {
1230 String name = this.getSuperOperationFacade().getValidationName();
1231 return name;
1232 }
1233
1234
1235
1236
1237
1238 @Override
1239 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1240 {
1241 this.getSuperOperationFacade().validateInvariants(validationMessages);
1242 }
1243
1244
1245
1246
1247 private static final String NAME_PROPERTY = "name";
1248 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1249
1250
1251
1252
1253 @Override
1254 public String toString()
1255 {
1256 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1257 toString.append("[");
1258 try
1259 {
1260 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1261 }
1262 catch (final Throwable tryAgain)
1263 {
1264 try
1265 {
1266 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1267 }
1268 catch (final Throwable ignore)
1269 {
1270
1271 }
1272 }
1273 toString.append("]");
1274 return toString.toString();
1275 }
1276 }