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.ModelValidationMessage;
10 import org.andromda.metafacades.uml.ActorFacade;
11 import org.apache.log4j.Logger;
12 import org.omg.uml.behavioralelements.usecases.Actor;
13
14
15
16
17
18
19
20 public abstract class ActorFacadeLogic
21 extends ClassifierFacadeLogicImpl
22 implements ActorFacade
23 {
24
25
26
27
28 protected Actor metaObject;
29
30
31
32
33
34 protected ActorFacadeLogic(Actor metaObjectIn, String context)
35 {
36 super(metaObjectIn, getContext(context));
37 this.metaObject = metaObjectIn;
38 }
39
40
41
42
43 private static final Logger logger = Logger.getLogger(ActorFacadeLogic.class);
44
45
46
47
48
49
50 private static String getContext(String context)
51 {
52 if (context == null)
53 {
54 context = "org.andromda.metafacades.uml.ActorFacade";
55 }
56 return context;
57 }
58
59
60
61
62 @Override
63 public void resetMetafacadeContext(String context)
64 {
65 if (!this.contextRoot)
66 {
67 context = getContext(context);
68 setMetafacadeContext (context);
69 }
70 }
71
72
73
74
75
76 public boolean isActorFacadeMetaType()
77 {
78 return true;
79 }
80
81
82
83 private List<ActorFacade> __getGeneralizedByActors1r;
84 private boolean __getGeneralizedByActors1rSet = false;
85
86
87
88
89
90 public final List<ActorFacade> getGeneralizedByActors()
91 {
92 List<ActorFacade> getGeneralizedByActors1r = this.__getGeneralizedByActors1r;
93 if (!this.__getGeneralizedByActors1rSet)
94 {
95
96 List result = handleGetGeneralizedByActors();
97 List shieldedResult = this.shieldedElements(result);
98 try
99 {
100 getGeneralizedByActors1r = (List<ActorFacade>)shieldedResult;
101 }
102 catch (ClassCastException ex)
103 {
104
105 ActorFacadeLogic.logger.warn("incorrect metafacade cast for ActorFacadeLogic.getGeneralizedByActors List<ActorFacade> " + result + ": " + shieldedResult);
106 }
107
108 this.__getGeneralizedByActors1r = getGeneralizedByActors1r;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__getGeneralizedByActors1rSet = true;
112 }
113 }
114 return getGeneralizedByActors1r;
115 }
116
117
118
119
120
121 protected abstract List handleGetGeneralizedByActors();
122
123 private List<ActorFacade> __getGeneralizedActors2r;
124 private boolean __getGeneralizedActors2rSet = false;
125
126
127
128
129
130 public final List<ActorFacade> getGeneralizedActors()
131 {
132 List<ActorFacade> getGeneralizedActors2r = this.__getGeneralizedActors2r;
133 if (!this.__getGeneralizedActors2rSet)
134 {
135
136 List result = handleGetGeneralizedActors();
137 List shieldedResult = this.shieldedElements(result);
138 try
139 {
140 getGeneralizedActors2r = (List<ActorFacade>)shieldedResult;
141 }
142 catch (ClassCastException ex)
143 {
144
145 ActorFacadeLogic.logger.warn("incorrect metafacade cast for ActorFacadeLogic.getGeneralizedActors List<ActorFacade> " + result + ": " + shieldedResult);
146 }
147
148 this.__getGeneralizedActors2r = getGeneralizedActors2r;
149 if (isMetafacadePropertyCachingEnabled())
150 {
151 this.__getGeneralizedActors2rSet = true;
152 }
153 }
154 return getGeneralizedActors2r;
155 }
156
157
158
159
160
161 protected abstract List handleGetGeneralizedActors();
162
163
164
165
166
167 @Override
168 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
169 {
170 super.validateInvariants(validationMessages);
171 }
172 }