View Javadoc
1   package org.andromda.cartridges.jsf2.metafacades;
2   
3   import java.util.Collection;
4   import org.andromda.metafacades.uml.DependencyFacade;
5   import org.andromda.metafacades.uml.ModelElementFacade;
6   import org.andromda.metafacades.uml.UseCaseFacade;
7   
8   /**
9    * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences.
10   *
11   * @see org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences
12   */
13  public class JSFPortletPreferencesLogicImpl
14      extends JSFPortletPreferencesLogic
15  {
16      private static final long serialVersionUID = 34L;
17      /**
18       * @param metaObject
19       * @param context
20       */
21      public JSFPortletPreferencesLogicImpl(Object metaObject, String context)
22      {
23          super(metaObject, context);
24      }
25      /**
26       * @return useCase
27       * @see org.andromda.cartridges.jsf2.metafacades.JSFPortletPreferences#getUseCase()
28       */
29      protected Object handleGetUseCase()
30      {
31          UseCaseFacade useCase = null;
32          final Collection<DependencyFacade> dependencies = this.getTargetDependencies();
33          if (dependencies != null && !dependencies.isEmpty())
34          {
35              for (final DependencyFacade dependency : dependencies)
36              {
37                  final ModelElementFacade source = dependency.getSourceElement();
38                  if (source instanceof UseCaseFacade)
39                  {
40                      useCase = (UseCaseFacade)source;
41                      break;
42                  }
43              }
44          }
45          return useCase;
46      }
47  }