001// license-header java merge-point 002// 003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify! 004// 005package org.andromda.metafacades.uml14; 006 007import java.util.Collection; 008import java.util.List; 009import org.andromda.core.metafacade.MetafacadeBase; 010import org.andromda.core.metafacade.ModelValidationMessage; 011import org.andromda.metafacades.uml.FrontEndAction; 012import org.andromda.metafacades.uml.FrontEndActivityGraph; 013import org.andromda.metafacades.uml.FrontEndControllerOperation; 014import org.andromda.metafacades.uml.FrontEndEvent; 015import org.andromda.metafacades.uml.FrontEndForward; 016import org.andromda.metafacades.uml.FrontEndParameter; 017import org.andromda.metafacades.uml.FrontEndUseCase; 018import org.apache.log4j.Logger; 019import org.omg.uml.behavioralelements.statemachines.Transition; 020 021/** 022 * A front end forward is any transition between front-end states. 023 * MetafacadeLogic for FrontEndForward 024 * 025 * @see FrontEndForward 026 */ 027public abstract class FrontEndForwardLogic 028 extends TransitionFacadeLogicImpl 029 implements FrontEndForward 030{ 031 /** 032 * The underlying UML object 033 * @see Object 034 */ 035 protected Object metaObject; 036 037 /** Create Metafacade implementation instance using the MetafacadeFactory from the context 038 * @param metaObjectIn 039 * @param context 040 */ 041 protected FrontEndForwardLogic(Object metaObjectIn, String context) 042 { 043 super((Transition)metaObjectIn, getContext(context)); 044 this.metaObject = metaObjectIn; 045 } 046 047 /** 048 * The logger instance. 049 */ 050 private static final Logger logger = Logger.getLogger(FrontEndForwardLogic.class); 051 052 /** 053 * Gets the context for this metafacade logic instance. 054 * @param context String. Set to FrontEndForward if null 055 * @return context String 056 */ 057 private static String getContext(String context) 058 { 059 if (context == null) 060 { 061 context = "org.andromda.metafacades.uml.FrontEndForward"; 062 } 063 return context; 064 } 065 066 /** Reset context only for non-root metafacades 067 * @param context 068 */ 069 @Override 070 public void resetMetafacadeContext(String context) 071 { 072 if (!this.contextRoot) // reset context only for non-root metafacades 073 { 074 context = getContext(context); // to have same value as in original constructor call 075 setMetafacadeContext (context); 076 } 077 } 078 079 /** 080 * @return boolean true always 081 * @see FrontEndForward 082 */ 083 public boolean isFrontEndForwardMetaType() 084 { 085 return true; 086 } 087 088 // --------------- attributes --------------------- 089 090 /** 091 * @see FrontEndForward#isContainedInFrontEndUseCase() 092 * @return boolean 093 */ 094 protected abstract boolean handleIsContainedInFrontEndUseCase(); 095 096 private boolean __containedInFrontEndUseCase1a; 097 private boolean __containedInFrontEndUseCase1aSet = false; 098 099 /** 100 * Indicates if this forward is contained in a FrontEndUseCase. 101 * @return (boolean)handleIsContainedInFrontEndUseCase() 102 */ 103 public final boolean isContainedInFrontEndUseCase() 104 { 105 boolean containedInFrontEndUseCase1a = this.__containedInFrontEndUseCase1a; 106 if (!this.__containedInFrontEndUseCase1aSet) 107 { 108 // containedInFrontEndUseCase has no pre constraints 109 containedInFrontEndUseCase1a = handleIsContainedInFrontEndUseCase(); 110 // containedInFrontEndUseCase has no post constraints 111 this.__containedInFrontEndUseCase1a = containedInFrontEndUseCase1a; 112 if (isMetafacadePropertyCachingEnabled()) 113 { 114 this.__containedInFrontEndUseCase1aSet = true; 115 } 116 } 117 return containedInFrontEndUseCase1a; 118 } 119 120 /** 121 * @see FrontEndForward#getActionMethodName() 122 * @return String 123 */ 124 protected abstract String handleGetActionMethodName(); 125 126 private String __actionMethodName2a; 127 private boolean __actionMethodName2aSet = false; 128 129 /** 130 * The method name used to delegate to this forward. 131 * @return (String)handleGetActionMethodName() 132 */ 133 public final String getActionMethodName() 134 { 135 String actionMethodName2a = this.__actionMethodName2a; 136 if (!this.__actionMethodName2aSet) 137 { 138 // actionMethodName has no pre constraints 139 actionMethodName2a = handleGetActionMethodName(); 140 // actionMethodName has no post constraints 141 this.__actionMethodName2a = actionMethodName2a; 142 if (isMetafacadePropertyCachingEnabled()) 143 { 144 this.__actionMethodName2aSet = true; 145 } 146 } 147 return actionMethodName2a; 148 } 149 150 /** 151 * @see FrontEndForward#isEnteringView() 152 * @return boolean 153 */ 154 protected abstract boolean handleIsEnteringView(); 155 156 private boolean __enteringView3a; 157 private boolean __enteringView3aSet = false; 158 159 /** 160 * Indicates if this action directly targets a "front-end" view, false otherwise. 161 * @return (boolean)handleIsEnteringView() 162 */ 163 public final boolean isEnteringView() 164 { 165 boolean enteringView3a = this.__enteringView3a; 166 if (!this.__enteringView3aSet) 167 { 168 // enteringView has no pre constraints 169 enteringView3a = handleIsEnteringView(); 170 // enteringView has no post constraints 171 this.__enteringView3a = enteringView3a; 172 if (isMetafacadePropertyCachingEnabled()) 173 { 174 this.__enteringView3aSet = true; 175 } 176 } 177 return enteringView3a; 178 } 179 180 /** 181 * @see FrontEndForward#isExitingView() 182 * @return boolean 183 */ 184 protected abstract boolean handleIsExitingView(); 185 186 private boolean __exitingView4a; 187 private boolean __exitingView4aSet = false; 188 189 /** 190 * Indicates if this forward (transition) is coming out of a front-end view. 191 * @return (boolean)handleIsExitingView() 192 */ 193 public final boolean isExitingView() 194 { 195 boolean exitingView4a = this.__exitingView4a; 196 if (!this.__exitingView4aSet) 197 { 198 // exitingView has no pre constraints 199 exitingView4a = handleIsExitingView(); 200 // exitingView has no post constraints 201 this.__exitingView4a = exitingView4a; 202 if (isMetafacadePropertyCachingEnabled()) 203 { 204 this.__exitingView4aSet = true; 205 } 206 } 207 return exitingView4a; 208 } 209 210 // ------------- associations ------------------ 211 212 private FrontEndUseCase __getUseCase1r; 213 private boolean __getUseCase1rSet = false; 214 215 /** 216 * A front end forward is any transition between front-end states. 217 * @return (FrontEndUseCase)handleGetUseCase() 218 */ 219 public final FrontEndUseCase getUseCase() 220 { 221 FrontEndUseCase getUseCase1r = this.__getUseCase1r; 222 if (!this.__getUseCase1rSet) 223 { 224 // frontEndForward has no pre constraints 225 Object result = handleGetUseCase(); 226 MetafacadeBase shieldedResult = this.shieldedElement(result); 227 try 228 { 229 getUseCase1r = (FrontEndUseCase)shieldedResult; 230 } 231 catch (ClassCastException ex) 232 { 233 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 234 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getUseCase FrontEndUseCase " + result + ": " + shieldedResult); 235 } 236 // frontEndForward has no post constraints 237 this.__getUseCase1r = getUseCase1r; 238 if (isMetafacadePropertyCachingEnabled()) 239 { 240 this.__getUseCase1rSet = true; 241 } 242 } 243 return getUseCase1r; 244 } 245 246 /** 247 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 248 * @return Object 249 */ 250 protected abstract Object handleGetUseCase(); 251 252 private List<FrontEndAction> __getActions2r; 253 private boolean __getActions2rSet = false; 254 255 /** 256 * All the transitions that make up this action, this directly maps onto the forwards. 257 * @return (List<FrontEndAction>)handleGetActions() 258 */ 259 public final List<FrontEndAction> getActions() 260 { 261 List<FrontEndAction> getActions2r = this.__getActions2r; 262 if (!this.__getActions2rSet) 263 { 264 // transitions has no pre constraints 265 List result = handleGetActions(); 266 List shieldedResult = this.shieldedElements(result); 267 try 268 { 269 getActions2r = (List<FrontEndAction>)shieldedResult; 270 } 271 catch (ClassCastException ex) 272 { 273 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 274 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getActions List<FrontEndAction> " + result + ": " + shieldedResult); 275 } 276 // transitions has no post constraints 277 this.__getActions2r = getActions2r; 278 if (isMetafacadePropertyCachingEnabled()) 279 { 280 this.__getActions2rSet = true; 281 } 282 } 283 return getActions2r; 284 } 285 286 /** 287 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 288 * @return List 289 */ 290 protected abstract List handleGetActions(); 291 292 private FrontEndEvent __getDecisionTrigger3r; 293 private boolean __getDecisionTrigger3rSet = false; 294 295 /** 296 * A front end forward is any transition between front-end states. 297 * @return (FrontEndEvent)handleGetDecisionTrigger() 298 */ 299 public final FrontEndEvent getDecisionTrigger() 300 { 301 FrontEndEvent getDecisionTrigger3r = this.__getDecisionTrigger3r; 302 if (!this.__getDecisionTrigger3rSet) 303 { 304 // frontEndForward has no pre constraints 305 Object result = handleGetDecisionTrigger(); 306 MetafacadeBase shieldedResult = this.shieldedElement(result); 307 try 308 { 309 getDecisionTrigger3r = (FrontEndEvent)shieldedResult; 310 } 311 catch (ClassCastException ex) 312 { 313 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 314 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getDecisionTrigger FrontEndEvent " + result + ": " + shieldedResult); 315 } 316 // frontEndForward has no post constraints 317 this.__getDecisionTrigger3r = getDecisionTrigger3r; 318 if (isMetafacadePropertyCachingEnabled()) 319 { 320 this.__getDecisionTrigger3rSet = true; 321 } 322 } 323 return getDecisionTrigger3r; 324 } 325 326 /** 327 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 328 * @return Object 329 */ 330 protected abstract Object handleGetDecisionTrigger(); 331 332 private FrontEndControllerOperation __getOperationCall4r; 333 private boolean __getOperationCall4rSet = false; 334 335 /** 336 * A front end forward is any transition between front-end states. 337 * @return (FrontEndControllerOperation)handleGetOperationCall() 338 */ 339 public final FrontEndControllerOperation getOperationCall() 340 { 341 FrontEndControllerOperation getOperationCall4r = this.__getOperationCall4r; 342 if (!this.__getOperationCall4rSet) 343 { 344 // frontEndForward has no pre constraints 345 Object result = handleGetOperationCall(); 346 MetafacadeBase shieldedResult = this.shieldedElement(result); 347 try 348 { 349 getOperationCall4r = (FrontEndControllerOperation)shieldedResult; 350 } 351 catch (ClassCastException ex) 352 { 353 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 354 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getOperationCall FrontEndControllerOperation " + result + ": " + shieldedResult); 355 } 356 // frontEndForward has no post constraints 357 this.__getOperationCall4r = getOperationCall4r; 358 if (isMetafacadePropertyCachingEnabled()) 359 { 360 this.__getOperationCall4rSet = true; 361 } 362 } 363 return getOperationCall4r; 364 } 365 366 /** 367 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 368 * @return Object 369 */ 370 protected abstract Object handleGetOperationCall(); 371 372 private List<FrontEndParameter> __getForwardParameters5r; 373 private boolean __getForwardParameters5rSet = false; 374 375 /** 376 * A front end forward is any transition between front-end states. 377 * @return (List<FrontEndParameter>)handleGetForwardParameters() 378 */ 379 public final List<FrontEndParameter> getForwardParameters() 380 { 381 List<FrontEndParameter> getForwardParameters5r = this.__getForwardParameters5r; 382 if (!this.__getForwardParameters5rSet) 383 { 384 // frontEndForward has no pre constraints 385 List result = handleGetForwardParameters(); 386 List shieldedResult = this.shieldedElements(result); 387 try 388 { 389 getForwardParameters5r = (List<FrontEndParameter>)shieldedResult; 390 } 391 catch (ClassCastException ex) 392 { 393 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 394 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getForwardParameters List<FrontEndParameter> " + result + ": " + shieldedResult); 395 } 396 // frontEndForward has no post constraints 397 this.__getForwardParameters5r = getForwardParameters5r; 398 if (isMetafacadePropertyCachingEnabled()) 399 { 400 this.__getForwardParameters5rSet = true; 401 } 402 } 403 return getForwardParameters5r; 404 } 405 406 /** 407 * UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type 408 * @return List 409 */ 410 protected abstract List handleGetForwardParameters(); 411 412 private FrontEndActivityGraph __getFrontEndActivityGraph6r; 413 private boolean __getFrontEndActivityGraph6rSet = false; 414 415 /** 416 * A front end forward is any transition between front-end states. 417 * @return (FrontEndActivityGraph)handleGetFrontEndActivityGraph() 418 */ 419 public final FrontEndActivityGraph getFrontEndActivityGraph() 420 { 421 FrontEndActivityGraph getFrontEndActivityGraph6r = this.__getFrontEndActivityGraph6r; 422 if (!this.__getFrontEndActivityGraph6rSet) 423 { 424 // frontEndForward has no pre constraints 425 Object result = handleGetFrontEndActivityGraph(); 426 MetafacadeBase shieldedResult = this.shieldedElement(result); 427 try 428 { 429 getFrontEndActivityGraph6r = (FrontEndActivityGraph)shieldedResult; 430 } 431 catch (ClassCastException ex) 432 { 433 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn 434 FrontEndForwardLogic.logger.warn("incorrect metafacade cast for FrontEndForwardLogic.getFrontEndActivityGraph FrontEndActivityGraph " + result + ": " + shieldedResult); 435 } 436 // frontEndForward has no post constraints 437 this.__getFrontEndActivityGraph6r = getFrontEndActivityGraph6r; 438 if (isMetafacadePropertyCachingEnabled()) 439 { 440 this.__getFrontEndActivityGraph6rSet = true; 441 } 442 } 443 return getFrontEndActivityGraph6r; 444 } 445 446 /** 447 * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type 448 * @return Object 449 */ 450 protected abstract Object handleGetFrontEndActivityGraph(); 451 452 /** 453 * @param validationMessages Collection<ModelValidationMessage> 454 * @see TransitionFacadeLogicImpl#validateInvariants(Collection validationMessages) 455 */ 456 @Override 457 public void validateInvariants(Collection<ModelValidationMessage> validationMessages) 458 { 459 super.validateInvariants(validationMessages); 460 } 461}