View Javadoc
1   package org.andromda.cartridges.meta.metafacades;
2   import org.andromda.metafacades.uml.OperationFacade;
3   /**
4    * MetafacadeLogic implementation for
5    * org.andromda.cartridges.meta.metafacades.PSMmetaclass.
6    *
7    * @see org.andromda.cartridges.meta.metafacades.PSMmetaclass
8    * @author Bob Fields
9    */
10  public class PSMmetaclassLogicImpl extends PSMmetaclassLogic
11  {
12      private static final long serialVersionUID = 34L;
13      /**
14       * @param metaObjectIn
15       * @param context
16       */
17      public PSMmetaclassLogicImpl(Object metaObjectIn, String context)
18      {
19          super(metaObjectIn, context);
20      }
21      /**
22       * @see org.andromda.cartridges.meta.metafacades.PSMmetaclass#isOperationsPresent()
23       */
24      @Override
25      protected boolean handleIsOperationsPresent()
26      {
27          return !this.getOperations().isEmpty();
28      }
29      /**
30       * @see org.andromda.cartridges.meta.metafacades.PSMmetaclassLogic#handleIsImplMustBeAbstract()
31       */
32      @Override
33      protected boolean handleIsImplMustBeAbstract()
34      {
35          boolean result = false;
36          // if the class itself is abstract, make the impl abstract, too.
37          if (this.isAbstract())
38          {
39              result = true;
40          }
41          else
42          {
43              // if the class contains abstract operations, the impl must be
44              // abstract, too, because the abstract operations will not be
45              // generated as methods.
46              for (OperationFacade operation : this.getOperations())
47              {
48                  if (operation.isAbstract())
49                  {
50                      result = true;
51                      break;
52                  }
53              }
54          }
55          return result;
56      }
57  }