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.FrontEndFinalState;
12 import org.andromda.metafacades.uml.FrontEndParameter;
13 import org.andromda.metafacades.uml.FrontEndUseCase;
14 import org.apache.log4j.Logger;
15 import org.omg.uml.behavioralelements.statemachines.FinalState;
16
17
18
19
20
21
22
23
24 public abstract class FrontEndFinalStateLogic
25 extends FinalStateFacadeLogicImpl
26 implements FrontEndFinalState
27 {
28
29
30
31
32 protected Object metaObject;
33
34
35
36
37
38 protected FrontEndFinalStateLogic(Object metaObjectIn, String context)
39 {
40 super((FinalState)metaObjectIn, getContext(context));
41 this.metaObject = metaObjectIn;
42 }
43
44
45
46
47 private static final Logger logger = Logger.getLogger(FrontEndFinalStateLogic.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.FrontEndFinalState";
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 isFrontEndFinalStateMetaType()
81 {
82 return true;
83 }
84
85
86
87
88
89
90
91 protected abstract boolean handleIsContainedInFrontEndUseCase();
92
93 private boolean __containedInFrontEndUseCase1a;
94 private boolean __containedInFrontEndUseCase1aSet = false;
95
96
97
98
99
100 public final boolean isContainedInFrontEndUseCase()
101 {
102 boolean containedInFrontEndUseCase1a = this.__containedInFrontEndUseCase1a;
103 if (!this.__containedInFrontEndUseCase1aSet)
104 {
105
106 containedInFrontEndUseCase1a = handleIsContainedInFrontEndUseCase();
107
108 this.__containedInFrontEndUseCase1a = containedInFrontEndUseCase1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__containedInFrontEndUseCase1aSet = true;
112 }
113 }
114 return containedInFrontEndUseCase1a;
115 }
116
117
118
119 private FrontEndUseCase __getTargetUseCase1r;
120 private boolean __getTargetUseCase1rSet = false;
121
122
123
124
125
126 public final FrontEndUseCase getTargetUseCase()
127 {
128 FrontEndUseCase getTargetUseCase1r = this.__getTargetUseCase1r;
129 if (!this.__getTargetUseCase1rSet)
130 {
131
132 Object result = handleGetTargetUseCase();
133 MetafacadeBase shieldedResult = this.shieldedElement(result);
134 try
135 {
136 getTargetUseCase1r = (FrontEndUseCase)shieldedResult;
137 }
138 catch (ClassCastException ex)
139 {
140
141 FrontEndFinalStateLogic.logger.warn("incorrect metafacade cast for FrontEndFinalStateLogic.getTargetUseCase FrontEndUseCase " + result + ": " + shieldedResult);
142 }
143
144 this.__getTargetUseCase1r = getTargetUseCase1r;
145 if (isMetafacadePropertyCachingEnabled())
146 {
147 this.__getTargetUseCase1rSet = true;
148 }
149 }
150 return getTargetUseCase1r;
151 }
152
153
154
155
156
157 protected abstract Object handleGetTargetUseCase();
158
159 private List<FrontEndParameter> __getInterUseCaseParameters2r;
160 private boolean __getInterUseCaseParameters2rSet = false;
161
162
163
164
165
166
167
168 public final List<FrontEndParameter> getInterUseCaseParameters()
169 {
170 List<FrontEndParameter> getInterUseCaseParameters2r = this.__getInterUseCaseParameters2r;
171 if (!this.__getInterUseCaseParameters2rSet)
172 {
173
174 List result = handleGetInterUseCaseParameters();
175 List shieldedResult = this.shieldedElements(result);
176 try
177 {
178 getInterUseCaseParameters2r = (List<FrontEndParameter>)shieldedResult;
179 }
180 catch (ClassCastException ex)
181 {
182
183 FrontEndFinalStateLogic.logger.warn("incorrect metafacade cast for FrontEndFinalStateLogic.getInterUseCaseParameters List<FrontEndParameter> " + result + ": " + shieldedResult);
184 }
185
186 this.__getInterUseCaseParameters2r = getInterUseCaseParameters2r;
187 if (isMetafacadePropertyCachingEnabled())
188 {
189 this.__getInterUseCaseParameters2rSet = true;
190 }
191 }
192 return getInterUseCaseParameters2r;
193 }
194
195
196
197
198
199 protected abstract List handleGetInterUseCaseParameters();
200
201
202
203
204
205 @Override
206 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
207 {
208 super.validateInvariants(validationMessages);
209 }
210 }