View Javadoc
1   package org.andromda.metafacades.emf.uml22;
2   
3   import java.util.ArrayList;
4   import java.util.Collection;
5   import java.util.List;
6   import org.andromda.metafacades.uml.ActorFacade;
7   import org.andromda.metafacades.uml.GeneralizableElementFacade;
8   import org.eclipse.uml2.uml.Actor;
9   
10  /**
11   * MetafacadeLogic implementation for org.andromda.metafacades.uml.ActorFacade.
12   *
13   * @see org.andromda.metafacades.uml.ActorFacade
14   */
15  public class ActorFacadeLogicImpl
16      extends ActorFacadeLogic
17  {
18      private static final long serialVersionUID = 34L;
19      /**
20       * @param metaObject
21       * @param context
22       */
23      public ActorFacadeLogicImpl(
24          final Actor metaObject,
25          final String context)
26      {
27          super(metaObject, context);
28      }
29  
30      /**
31       * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
32       */
33      @Override
34      public Object getValidationOwner()
35      {
36          return this.getPackage();
37      }
38  
39      /**
40       * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedActors()
41       */
42      @Override
43      protected List<ActorFacade> handleGetGeneralizedActors()
44      {
45          final List<ActorFacade> generalizedActors = new ArrayList<ActorFacade>();
46  
47          final Collection<GeneralizableElementFacade> parentActors = this.getGeneralizations();
48          for (final GeneralizableElementFacade object : parentActors)
49          {
50              if (object instanceof ActorFacade)
51              {
52                  generalizedActors.add((ActorFacade) object);
53              }
54          }
55          return generalizedActors;
56      }
57  
58      /**
59       *
60       * @see org.andromda.metafacades.uml.ActorFacade#getGeneralizedByActors()
61       */
62      @Override
63      protected List<ActorFacade> handleGetGeneralizedByActors()
64      {
65          final List<ActorFacade> generalizedByActors = new ArrayList<ActorFacade>();
66  
67          final Collection<GeneralizableElementFacade> specializedActors = this.getSpecializations();
68          for (final GeneralizableElementFacade object : specializedActors)
69          {
70              if (object instanceof ActorFacade) {
71                  generalizedByActors.add((ActorFacade) object);
72              }
73          }
74          return generalizedByActors;
75      }
76  }