1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import java.util.List;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.ModelValidationMessage;
11 import org.andromda.metafacades.uml.ActorFacade;
12 import org.andromda.metafacades.uml.ManageableEntity;
13 import org.andromda.metafacades.uml.ManageableEntityAssociationEnd;
14 import org.andromda.metafacades.uml.ManageableEntityAttribute;
15 import org.andromda.metafacades.uml.ModelElementFacade;
16 import org.apache.log4j.Logger;
17
18
19
20
21
22
23
24 public abstract class ManageableEntityLogic
25 extends EntityLogicImpl
26 implements ManageableEntity
27 {
28
29
30
31
32 protected Object metaObject;
33
34
35
36
37
38 protected ManageableEntityLogic(Object metaObjectIn, String context)
39 {
40 super(metaObjectIn, getContext(context));
41 this.metaObject = metaObjectIn;
42 }
43
44
45
46
47 private static final Logger logger = Logger.getLogger(ManageableEntityLogic.class);
48
49
50
51
52
53
54 private static String getContext(String context)
55 {
56 if (context == null)
57 {
58 context = "org.andromda.metafacades.uml.ManageableEntity";
59 }
60 return context;
61 }
62
63
64
65
66 @Override
67 public void resetMetafacadeContext(String context)
68 {
69 if (!this.contextRoot)
70 {
71 context = getContext(context);
72 setMetafacadeContext (context);
73 }
74 }
75
76
77
78
79
80 public boolean isManageableEntityMetaType()
81 {
82 return true;
83 }
84
85
86
87
88
89
90
91 protected abstract String handleGetManageablePackageName();
92
93 private String __manageablePackageName1a;
94 private boolean __manageablePackageName1aSet = false;
95
96
97
98
99
100 public final String getManageablePackageName()
101 {
102 String manageablePackageName1a = this.__manageablePackageName1a;
103 if (!this.__manageablePackageName1aSet)
104 {
105
106 manageablePackageName1a = handleGetManageablePackageName();
107
108 this.__manageablePackageName1a = manageablePackageName1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__manageablePackageName1aSet = true;
112 }
113 }
114 return manageablePackageName1a;
115 }
116
117
118
119
120
121 protected abstract String handleGetManageableServiceAccessorCall();
122
123 private String __manageableServiceAccessorCall2a;
124 private boolean __manageableServiceAccessorCall2aSet = false;
125
126
127
128
129
130 public final String getManageableServiceAccessorCall()
131 {
132 String manageableServiceAccessorCall2a = this.__manageableServiceAccessorCall2a;
133 if (!this.__manageableServiceAccessorCall2aSet)
134 {
135
136 manageableServiceAccessorCall2a = handleGetManageableServiceAccessorCall();
137
138 this.__manageableServiceAccessorCall2a = manageableServiceAccessorCall2a;
139 if (isMetafacadePropertyCachingEnabled())
140 {
141 this.__manageableServiceAccessorCall2aSet = true;
142 }
143 }
144 return manageableServiceAccessorCall2a;
145 }
146
147
148
149
150
151 protected abstract boolean handleIsRead();
152
153 private boolean __read3a;
154 private boolean __read3aSet = false;
155
156
157
158
159
160 public final boolean isRead()
161 {
162 boolean read3a = this.__read3a;
163 if (!this.__read3aSet)
164 {
165
166 read3a = handleIsRead();
167
168 this.__read3a = read3a;
169 if (isMetafacadePropertyCachingEnabled())
170 {
171 this.__read3aSet = true;
172 }
173 }
174 return read3a;
175 }
176
177
178
179
180
181 protected abstract boolean handleIsCreate();
182
183 private boolean __create4a;
184 private boolean __create4aSet = false;
185
186
187
188
189
190 public final boolean isCreate()
191 {
192 boolean create4a = this.__create4a;
193 if (!this.__create4aSet)
194 {
195
196 create4a = handleIsCreate();
197
198 this.__create4a = create4a;
199 if (isMetafacadePropertyCachingEnabled())
200 {
201 this.__create4aSet = true;
202 }
203 }
204 return create4a;
205 }
206
207
208
209
210
211 protected abstract boolean handleIsUpdate();
212
213 private boolean __update5a;
214 private boolean __update5aSet = false;
215
216
217
218
219
220 public final boolean isUpdate()
221 {
222 boolean update5a = this.__update5a;
223 if (!this.__update5aSet)
224 {
225
226 update5a = handleIsUpdate();
227
228 this.__update5a = update5a;
229 if (isMetafacadePropertyCachingEnabled())
230 {
231 this.__update5aSet = true;
232 }
233 }
234 return update5a;
235 }
236
237
238
239
240
241 protected abstract boolean handleIsDelete();
242
243 private boolean __delete6a;
244 private boolean __delete6aSet = false;
245
246
247
248
249
250 public final boolean isDelete()
251 {
252 boolean delete6a = this.__delete6a;
253 if (!this.__delete6aSet)
254 {
255
256 delete6a = handleIsDelete();
257
258 this.__delete6a = delete6a;
259 if (isMetafacadePropertyCachingEnabled())
260 {
261 this.__delete6aSet = true;
262 }
263 }
264 return delete6a;
265 }
266
267
268
269
270
271 protected abstract String handleGetManageablePackagePath();
272
273 private String __manageablePackagePath7a;
274 private boolean __manageablePackagePath7aSet = false;
275
276
277
278
279
280 public final String getManageablePackagePath()
281 {
282 String manageablePackagePath7a = this.__manageablePackagePath7a;
283 if (!this.__manageablePackagePath7aSet)
284 {
285
286 manageablePackagePath7a = handleGetManageablePackagePath();
287
288 this.__manageablePackagePath7a = manageablePackagePath7a;
289 if (isMetafacadePropertyCachingEnabled())
290 {
291 this.__manageablePackagePath7aSet = true;
292 }
293 }
294 return manageablePackagePath7a;
295 }
296
297
298
299
300
301 protected abstract String handleGetManageableServiceName();
302
303 private String __manageableServiceName8a;
304 private boolean __manageableServiceName8aSet = false;
305
306
307
308
309
310 public final String getManageableServiceName()
311 {
312 String manageableServiceName8a = this.__manageableServiceName8a;
313 if (!this.__manageableServiceName8aSet)
314 {
315
316 manageableServiceName8a = handleGetManageableServiceName();
317
318 this.__manageableServiceName8a = manageableServiceName8a;
319 if (isMetafacadePropertyCachingEnabled())
320 {
321 this.__manageableServiceName8aSet = true;
322 }
323 }
324 return manageableServiceName8a;
325 }
326
327
328
329
330
331 protected abstract String handleGetFullyQualifiedManageableServiceName();
332
333 private String __fullyQualifiedManageableServiceName9a;
334 private boolean __fullyQualifiedManageableServiceName9aSet = false;
335
336
337
338
339
340 public final String getFullyQualifiedManageableServiceName()
341 {
342 String fullyQualifiedManageableServiceName9a = this.__fullyQualifiedManageableServiceName9a;
343 if (!this.__fullyQualifiedManageableServiceName9aSet)
344 {
345
346 fullyQualifiedManageableServiceName9a = handleGetFullyQualifiedManageableServiceName();
347
348 this.__fullyQualifiedManageableServiceName9a = fullyQualifiedManageableServiceName9a;
349 if (isMetafacadePropertyCachingEnabled())
350 {
351 this.__fullyQualifiedManageableServiceName9aSet = true;
352 }
353 }
354 return fullyQualifiedManageableServiceName9a;
355 }
356
357
358
359
360
361 protected abstract String handleGetManageableServiceFullPath();
362
363 private String __manageableServiceFullPath10a;
364 private boolean __manageableServiceFullPath10aSet = false;
365
366
367
368
369
370 public final String getManageableServiceFullPath()
371 {
372 String manageableServiceFullPath10a = this.__manageableServiceFullPath10a;
373 if (!this.__manageableServiceFullPath10aSet)
374 {
375
376 manageableServiceFullPath10a = handleGetManageableServiceFullPath();
377
378 this.__manageableServiceFullPath10a = manageableServiceFullPath10a;
379 if (isMetafacadePropertyCachingEnabled())
380 {
381 this.__manageableServiceFullPath10aSet = true;
382 }
383 }
384 return manageableServiceFullPath10a;
385 }
386
387
388
389
390
391 protected abstract List<ModelElementFacade> handleGetManageableMembers();
392
393 private List<ModelElementFacade> __manageableMembers11a;
394 private boolean __manageableMembers11aSet = false;
395
396
397
398
399
400 public final List<ModelElementFacade> getManageableMembers()
401 {
402 List<ModelElementFacade> manageableMembers11a = this.__manageableMembers11a;
403 if (!this.__manageableMembers11aSet)
404 {
405
406 manageableMembers11a = handleGetManageableMembers();
407
408 this.__manageableMembers11a = manageableMembers11a;
409 if (isMetafacadePropertyCachingEnabled())
410 {
411 this.__manageableMembers11aSet = true;
412 }
413 }
414 return manageableMembers11a;
415 }
416
417
418
419
420
421 protected abstract boolean handleIsManageable();
422
423 private boolean __manageable12a;
424 private boolean __manageable12aSet = false;
425
426
427
428
429
430 public final boolean isManageable()
431 {
432 boolean manageable12a = this.__manageable12a;
433 if (!this.__manageable12aSet)
434 {
435
436 manageable12a = handleIsManageable();
437
438 this.__manageable12a = manageable12a;
439 if (isMetafacadePropertyCachingEnabled())
440 {
441 this.__manageable12aSet = true;
442 }
443 }
444 return manageable12a;
445 }
446
447
448
449
450
451 protected abstract int handleGetMaximumListSize();
452
453 private int __maximumListSize13a;
454 private boolean __maximumListSize13aSet = false;
455
456
457
458
459
460 public final int getMaximumListSize()
461 {
462 int maximumListSize13a = this.__maximumListSize13a;
463 if (!this.__maximumListSize13aSet)
464 {
465
466 maximumListSize13a = handleGetMaximumListSize();
467
468 this.__maximumListSize13a = maximumListSize13a;
469 if (isMetafacadePropertyCachingEnabled())
470 {
471 this.__maximumListSize13aSet = true;
472 }
473 }
474 return maximumListSize13a;
475 }
476
477
478
479
480
481 protected abstract int handleGetPageSize();
482
483 private int __pageSize14a;
484 private boolean __pageSize14aSet = false;
485
486
487
488
489
490 public final int getPageSize()
491 {
492 int pageSize14a = this.__pageSize14a;
493 if (!this.__pageSize14aSet)
494 {
495
496 pageSize14a = handleGetPageSize();
497
498 this.__pageSize14a = pageSize14a;
499 if (isMetafacadePropertyCachingEnabled())
500 {
501 this.__pageSize14aSet = true;
502 }
503 }
504 return pageSize14a;
505 }
506
507
508
509
510
511 protected abstract boolean handleIsResolveable();
512
513 private boolean __resolveable15a;
514 private boolean __resolveable15aSet = false;
515
516
517
518
519
520 public final boolean isResolveable()
521 {
522 boolean resolveable15a = this.__resolveable15a;
523 if (!this.__resolveable15aSet)
524 {
525
526 resolveable15a = handleIsResolveable();
527
528 this.__resolveable15a = resolveable15a;
529 if (isMetafacadePropertyCachingEnabled())
530 {
531 this.__resolveable15aSet = true;
532 }
533 }
534 return resolveable15a;
535 }
536
537
538
539
540
541
542
543
544
545 protected abstract String handleListManageableMembers(boolean withTypes);
546
547
548
549
550
551
552
553
554 public String listManageableMembers(boolean withTypes)
555 {
556
557 String returnValue = handleListManageableMembers(withTypes);
558
559 return returnValue;
560 }
561
562
563
564
565
566
567 protected abstract String handleListManageableMembersWithWrapperTypes();
568
569
570
571
572
573 public String listManageableMembersWithWrapperTypes()
574 {
575
576 String returnValue = handleListManageableMembersWithWrapperTypes();
577
578 return returnValue;
579 }
580
581
582
583 private List<ActorFacade> __getUsers1r;
584 private boolean __getUsers1rSet = false;
585
586
587
588
589
590
591 public final List<ActorFacade> getUsers()
592 {
593 List<ActorFacade> getUsers1r = this.__getUsers1r;
594 if (!this.__getUsers1rSet)
595 {
596
597 List result = handleGetUsers();
598 List shieldedResult = this.shieldedElements(result);
599 try
600 {
601 getUsers1r = (List<ActorFacade>)shieldedResult;
602 }
603 catch (ClassCastException ex)
604 {
605
606 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getUsers List<ActorFacade> " + result + ": " + shieldedResult);
607 }
608
609 this.__getUsers1r = getUsers1r;
610 if (isMetafacadePropertyCachingEnabled())
611 {
612 this.__getUsers1rSet = true;
613 }
614 }
615 return getUsers1r;
616 }
617
618
619
620
621
622 protected abstract List handleGetUsers();
623
624 private List<ManageableEntityAssociationEnd> __getManageableAssociationEnds2r;
625 private boolean __getManageableAssociationEnds2rSet = false;
626
627
628
629
630
631
632 public final List<ManageableEntityAssociationEnd> getManageableAssociationEnds()
633 {
634 List<ManageableEntityAssociationEnd> getManageableAssociationEnds2r = this.__getManageableAssociationEnds2r;
635 if (!this.__getManageableAssociationEnds2rSet)
636 {
637
638 List result = handleGetManageableAssociationEnds();
639 List shieldedResult = this.shieldedElements(result);
640 try
641 {
642 getManageableAssociationEnds2r = (List<ManageableEntityAssociationEnd>)shieldedResult;
643 }
644 catch (ClassCastException ex)
645 {
646
647 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableAssociationEnds List<ManageableEntityAssociationEnd> " + result + ": " + shieldedResult);
648 }
649
650 this.__getManageableAssociationEnds2r = getManageableAssociationEnds2r;
651 if (isMetafacadePropertyCachingEnabled())
652 {
653 this.__getManageableAssociationEnds2rSet = true;
654 }
655 }
656 return getManageableAssociationEnds2r;
657 }
658
659
660
661
662
663 protected abstract List handleGetManageableAssociationEnds();
664
665 private ManageableEntityAttribute __getDisplayAttribute3r;
666 private boolean __getDisplayAttribute3rSet = false;
667
668
669
670
671
672
673 public final ManageableEntityAttribute getDisplayAttribute()
674 {
675 ManageableEntityAttribute getDisplayAttribute3r = this.__getDisplayAttribute3r;
676 if (!this.__getDisplayAttribute3rSet)
677 {
678
679 Object result = handleGetDisplayAttribute();
680 MetafacadeBase shieldedResult = this.shieldedElement(result);
681 try
682 {
683 getDisplayAttribute3r = (ManageableEntityAttribute)shieldedResult;
684 }
685 catch (ClassCastException ex)
686 {
687
688 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getDisplayAttribute ManageableEntityAttribute " + result + ": " + shieldedResult);
689 }
690
691 this.__getDisplayAttribute3r = getDisplayAttribute3r;
692 if (isMetafacadePropertyCachingEnabled())
693 {
694 this.__getDisplayAttribute3rSet = true;
695 }
696 }
697 return getDisplayAttribute3r;
698 }
699
700
701
702
703
704 protected abstract Object handleGetDisplayAttribute();
705
706
707
708
709
710
711 public final List<ManageableEntity> getReferencingManageables()
712 {
713 List<ManageableEntity> getReferencingManageables4r = null;
714
715 List result = handleGetReferencingManageables();
716 List shieldedResult = this.shieldedElements(result);
717 try
718 {
719 getReferencingManageables4r = (List<ManageableEntity>)shieldedResult;
720 }
721 catch (ClassCastException ex)
722 {
723
724 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getReferencingManageables List<ManageableEntity> " + result + ": " + shieldedResult);
725 }
726
727 return getReferencingManageables4r;
728 }
729
730
731
732
733
734 protected abstract List handleGetReferencingManageables();
735
736 private List<ManageableEntity> __getAllManageables5r;
737 private boolean __getAllManageables5rSet = false;
738
739
740
741
742
743
744 public final List<ManageableEntity> getAllManageables()
745 {
746 List<ManageableEntity> getAllManageables5r = this.__getAllManageables5r;
747 if (!this.__getAllManageables5rSet)
748 {
749
750 List result = handleGetAllManageables();
751 List shieldedResult = this.shieldedElements(result);
752 try
753 {
754 getAllManageables5r = (List<ManageableEntity>)shieldedResult;
755 }
756 catch (ClassCastException ex)
757 {
758
759 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getAllManageables List<ManageableEntity> " + result + ": " + shieldedResult);
760 }
761
762 this.__getAllManageables5r = getAllManageables5r;
763 if (isMetafacadePropertyCachingEnabled())
764 {
765 this.__getAllManageables5rSet = true;
766 }
767 }
768 return getAllManageables5r;
769 }
770
771
772
773
774
775 protected abstract List handleGetAllManageables();
776
777 private List<ManageableEntityAttribute> __getManageableAttributes6r;
778 private boolean __getManageableAttributes6rSet = false;
779
780
781
782
783
784
785 public final List<ManageableEntityAttribute> getManageableAttributes()
786 {
787 List<ManageableEntityAttribute> getManageableAttributes6r = this.__getManageableAttributes6r;
788 if (!this.__getManageableAttributes6rSet)
789 {
790
791 List result = handleGetManageableAttributes();
792 List shieldedResult = this.shieldedElements(result);
793 try
794 {
795 getManageableAttributes6r = (List<ManageableEntityAttribute>)shieldedResult;
796 }
797 catch (ClassCastException ex)
798 {
799
800 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableAttributes List<ManageableEntityAttribute> " + result + ": " + shieldedResult);
801 }
802
803 this.__getManageableAttributes6r = getManageableAttributes6r;
804 if (isMetafacadePropertyCachingEnabled())
805 {
806 this.__getManageableAttributes6rSet = true;
807 }
808 }
809 return getManageableAttributes6r;
810 }
811
812
813
814
815
816 protected abstract List handleGetManageableAttributes();
817
818 private ManageableEntityAttribute __getManageableIdentifier7r;
819 private boolean __getManageableIdentifier7rSet = false;
820
821
822
823
824
825
826 public final ManageableEntityAttribute getManageableIdentifier()
827 {
828 ManageableEntityAttribute getManageableIdentifier7r = this.__getManageableIdentifier7r;
829 if (!this.__getManageableIdentifier7rSet)
830 {
831
832 Object result = handleGetManageableIdentifier();
833 MetafacadeBase shieldedResult = this.shieldedElement(result);
834 try
835 {
836 getManageableIdentifier7r = (ManageableEntityAttribute)shieldedResult;
837 }
838 catch (ClassCastException ex)
839 {
840
841 ManageableEntityLogic.logger.warn("incorrect metafacade cast for ManageableEntityLogic.getManageableIdentifier ManageableEntityAttribute " + result + ": " + shieldedResult);
842 }
843
844 this.__getManageableIdentifier7r = getManageableIdentifier7r;
845 if (isMetafacadePropertyCachingEnabled())
846 {
847 this.__getManageableIdentifier7rSet = true;
848 }
849 }
850 return getManageableIdentifier7r;
851 }
852
853
854
855
856
857 protected abstract Object handleGetManageableIdentifier();
858
859
860
861
862
863 @Override
864 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
865 {
866 super.validateInvariants(validationMessages);
867 }
868 }