View Javadoc
1   package org.andromda.metafacades.uml14;
2   
3   import java.util.Collection;
4   import java.util.Iterator;
5   import org.andromda.utils.StringUtilsHelper;
6   import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
7   import org.omg.uml.foundation.core.ModelElement;
8   import org.omg.uml.behavioralelements.usecases.UseCase;
9   
10  /**
11   * Metaclass facade implementation.
12   * @author Bob Fields
13   */
14  public class UseCaseFacadeLogicImpl
15      extends UseCaseFacadeLogic
16  {
17      private static final long serialVersionUID = 2563683138479430934L;
18  
19      /**
20       * @param metaObject
21       * @param context
22       */
23      public UseCaseFacadeLogicImpl(
24          UseCase metaObject,
25          String context)
26      {
27          super(metaObject, context);
28      }
29  
30      /**
31       * @see org.andromda.metafacades.uml14.ModelElementFacadeLogic#handleGetName()
32       */
33      protected String handleGetName()
34      {
35          return StringUtilsHelper.toSingleLine(super.handleGetName());
36      }
37  
38      /**
39       * @see org.andromda.metafacades.uml14.UseCaseFacadeLogic#handleGetFirstActivityGraph()
40       */
41      protected ActivityGraph handleGetFirstActivityGraph()
42      {
43          ActivityGraph activityGraph = null;
44  
45          for (final Iterator iterator = metaObject.getOwnedElement().iterator();
46              iterator.hasNext() && activityGraph == null;)
47          {
48              final ModelElement modelElement = (ModelElement)iterator.next();
49              if (modelElement instanceof ActivityGraph)
50              {
51                  activityGraph = (ActivityGraph)modelElement;
52              }
53          }
54  
55          return activityGraph;
56      }
57  
58      /**
59       * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
60       */
61      public Object getValidationOwner()
62      {
63          return getPackage();
64      }
65  
66      /**
67       * @see org.andromda.metafacades.uml.UseCaseFacade#getExtensionPoints()
68       */
69      @Override
70      protected Collection handleGetExtensionPoints()
71      {
72          return metaObject.getExtensionPoint();
73      }
74  
75      /**
76       * @see org.andromda.metafacades.uml.UseCaseFacade#getExtends()
77       */
78      @Override
79      protected Collection handleGetExtends()
80      {
81          return metaObject.getExtend();
82      }
83  
84      /**
85       * @see org.andromda.metafacades.uml.UseCaseFacade#getIncludes()
86       */
87      @Override
88      protected Collection handleGetIncludes()
89      {
90          return metaObject.getInclude();
91      }
92  }