1
2
3
4
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.MetafacadeBase;
9 import org.andromda.core.metafacade.ModelValidationMessage;
10 import org.andromda.metafacades.uml.FrontEndAction;
11 import org.andromda.metafacades.uml.FrontEndActivityGraph;
12 import org.andromda.metafacades.uml.FrontEndController;
13 import org.apache.log4j.Logger;
14 import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
15
16
17
18
19
20
21
22
23 public abstract class FrontEndActivityGraphLogic
24 extends ActivityGraphFacadeLogicImpl
25 implements FrontEndActivityGraph
26 {
27
28
29
30
31 protected Object metaObject;
32
33
34
35
36
37 protected FrontEndActivityGraphLogic(Object metaObjectIn, String context)
38 {
39 super((ActivityGraph)metaObjectIn, getContext(context));
40 this.metaObject = metaObjectIn;
41 }
42
43
44
45
46 private static final Logger logger = Logger.getLogger(FrontEndActivityGraphLogic.class);
47
48
49
50
51
52
53 private static String getContext(String context)
54 {
55 if (context == null)
56 {
57 context = "org.andromda.metafacades.uml.FrontEndActivityGraph";
58 }
59 return context;
60 }
61
62
63
64
65 @Override
66 public void resetMetafacadeContext(String context)
67 {
68 if (!this.contextRoot)
69 {
70 context = getContext(context);
71 setMetafacadeContext (context);
72 }
73 }
74
75
76
77
78
79 public boolean isFrontEndActivityGraphMetaType()
80 {
81 return true;
82 }
83
84
85
86
87
88
89
90 protected abstract boolean handleIsContainedInFrontEndUseCase();
91
92 private boolean __containedInFrontEndUseCase1a;
93 private boolean __containedInFrontEndUseCase1aSet = false;
94
95
96
97
98
99 public final boolean isContainedInFrontEndUseCase()
100 {
101 boolean containedInFrontEndUseCase1a = this.__containedInFrontEndUseCase1a;
102 if (!this.__containedInFrontEndUseCase1aSet)
103 {
104
105 containedInFrontEndUseCase1a = handleIsContainedInFrontEndUseCase();
106
107 this.__containedInFrontEndUseCase1a = containedInFrontEndUseCase1a;
108 if (isMetafacadePropertyCachingEnabled())
109 {
110 this.__containedInFrontEndUseCase1aSet = true;
111 }
112 }
113 return containedInFrontEndUseCase1a;
114 }
115
116
117
118 private FrontEndController __getController1r;
119 private boolean __getController1rSet = false;
120
121
122
123
124
125
126 public final FrontEndController getController()
127 {
128 FrontEndController getController1r = this.__getController1r;
129 if (!this.__getController1rSet)
130 {
131
132 Object result = handleGetController();
133 MetafacadeBase shieldedResult = this.shieldedElement(result);
134 try
135 {
136 getController1r = (FrontEndController)shieldedResult;
137 }
138 catch (ClassCastException ex)
139 {
140
141 FrontEndActivityGraphLogic.logger.warn("incorrect metafacade cast for FrontEndActivityGraphLogic.getController FrontEndController " + result + ": " + shieldedResult);
142 }
143
144 this.__getController1r = getController1r;
145 if (isMetafacadePropertyCachingEnabled())
146 {
147 this.__getController1rSet = true;
148 }
149 }
150 return getController1r;
151 }
152
153
154
155
156
157 protected abstract Object handleGetController();
158
159 private FrontEndAction __getInitialAction2r;
160 private boolean __getInitialAction2rSet = false;
161
162
163
164
165
166
167 public final FrontEndAction getInitialAction()
168 {
169 FrontEndAction getInitialAction2r = this.__getInitialAction2r;
170 if (!this.__getInitialAction2rSet)
171 {
172
173 Object result = handleGetInitialAction();
174 MetafacadeBase shieldedResult = this.shieldedElement(result);
175 try
176 {
177 getInitialAction2r = (FrontEndAction)shieldedResult;
178 }
179 catch (ClassCastException ex)
180 {
181
182 FrontEndActivityGraphLogic.logger.warn("incorrect metafacade cast for FrontEndActivityGraphLogic.getInitialAction FrontEndAction " + result + ": " + shieldedResult);
183 }
184
185 this.__getInitialAction2r = getInitialAction2r;
186 if (isMetafacadePropertyCachingEnabled())
187 {
188 this.__getInitialAction2rSet = true;
189 }
190 }
191 return getInitialAction2r;
192 }
193
194
195
196
197
198 protected abstract Object handleGetInitialAction();
199
200
201
202
203
204 @Override
205 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
206 {
207 super.validateInvariants(validationMessages);
208 }
209 }