01: package org.andromda.cartridges.jsf.metafacades;
02:
03: import org.andromda.cartridges.jsf.metafacades.JSFFinalStateLogic;
04: import org.andromda.cartridges.jsf.metafacades.JSFUseCase;
05: import org.andromda.metafacades.uml.FrontEndUseCase;
06: import org.andromda.metafacades.uml.UMLProfile;
07:
08: /**
09: * MetafacadeLogic implementation for org.andromda.cartridges.jsf.metafacades.JSFFinalState.
10: *
11: * @see org.andromda.cartridges.jsf.metafacades.JSFFinalState
12: */
13: public class JSFFinalStateLogicImpl extends JSFFinalStateLogic {
14:
15: public JSFFinalStateLogicImpl(Object metaObject, String context) {
16: super (metaObject, context);
17: }
18:
19: /**
20: * @see org.andromda.cartridges.jsf.metafacades.JSFFinalState#getPath()
21: */
22: protected java.lang.String handleGetPath() {
23: String fullPath = null;
24:
25: FrontEndUseCase useCase = this .getTargetUseCase();
26: if (useCase == null) {
27: // - perhaps this final state links outside of the UML model
28: final Object taggedValue = this
29: .findTaggedValue(UMLProfile.TAGGEDVALUE_EXTERNAL_HYPERLINK);
30: if (taggedValue == null) {
31: String name = getName();
32: if (name != null
33: && (name.startsWith("/")
34: || name.startsWith("http://") || name
35: .startsWith("file:"))) {
36: fullPath = name;
37: }
38: } else {
39: fullPath = String.valueOf(taggedValue);
40: }
41: } else if (useCase instanceof JSFUseCase) {
42: fullPath = ((JSFUseCase) useCase).getPath();
43: }
44:
45: return fullPath;
46: }
47:
48: }
|