View Javadoc
1   package org.andromda.cartridges.jsf.metafacades;
2   
3   import org.andromda.metafacades.uml.FrontEndUseCase;
4   import org.andromda.metafacades.uml.UMLProfile;
5   
6   /**
7    * MetafacadeLogic implementation for org.andromda.cartridges.jsf.metafacades.JSFFinalState.
8    *
9    * @see org.andromda.cartridges.jsf.metafacades.JSFFinalState
10   */
11  public class JSFFinalStateLogicImpl
12      extends JSFFinalStateLogic
13  {
14      private static final long serialVersionUID = 34L;
15      /**
16       * @param metaObject
17       * @param context
18       */
19      public JSFFinalStateLogicImpl(Object metaObject, String context)
20      {
21          super(metaObject, context);
22      }
23  
24      /**
25       * @return fullPath
26       * @see org.andromda.cartridges.jsf.metafacades.JSFFinalState#getPath()
27       */
28      protected String handleGetPath()
29      {
30          String fullPath = null;
31  
32          FrontEndUseCase useCase = this.getTargetUseCase();
33          if (useCase == null)
34          {
35              // - perhaps this final state links outside of the UML model
36              final Object taggedValue = this.findTaggedValue(UMLProfile.TAGGEDVALUE_EXTERNAL_HYPERLINK);
37              if (taggedValue == null)
38              {
39                  String name = getName();
40                  if (name != null && (name.startsWith("/") || name.startsWith("http://") || name.startsWith("file:")))
41                  {
42                      fullPath = name;
43                  }
44              }
45              else
46              {
47                  fullPath = String.valueOf(taggedValue);
48              }
49          }
50          else if (useCase instanceof JSFUseCase)
51          {
52              fullPath = ((JSFUseCase)useCase).getPath();
53          }
54  
55          return fullPath;
56      }
57  }