View Javadoc
1   package org.andromda.metafacades.emf.uml22;
2   
3   import org.andromda.metafacades.uml.UMLMetafacadeProperties;
4   import org.andromda.metafacades.uml.ValueObject;
5   
6   /**
7    * MetafacadeLogic implementation for
8    * org.andromda.metafacades.uml.ValueObjectAssociationEnd.
9    *
10   * @see org.andromda.metafacades.uml.ValueObjectAssociationEnd
11   */
12  public class ValueObjectAssociationEndLogicImpl
13      extends ValueObjectAssociationEndLogic
14  {
15      private static final long serialVersionUID = 34L;
16      /**
17       * @param metaObject
18       * @param context
19       */
20      public ValueObjectAssociationEndLogicImpl(
21          final Object metaObject,
22          final String context)
23      {
24          super(metaObject, context);
25      }
26  
27      /**
28       * Overridden to provide handling of array names within many type
29       * multiplicities.
30       *
31       * @see org.andromda.metafacades.uml.AssociationEndFacade#getGetterSetterTypeName()
32       */
33      @Override
34      protected String handleGetGetterSetterTypeName()
35      {
36          String name = super.handleGetGetterSetterTypeName();
37          if (this.isMany())
38          {
39              final boolean useArrays =
40                  Boolean.valueOf(
41                      String.valueOf(
42                          this.getConfiguredProperty(UMLMetafacadeProperties.USE_ARRAYS_FOR_MULTIPLICITIES_OF_TYPE_MANY)))
43                         .booleanValue();
44              if (useArrays)
45              {
46                  if (this.handleGetType() != null)
47                  {
48                      name = this.getType().getFullyQualifiedArrayName();
49                  }
50              }
51          }
52          return name;
53      }
54  
55      /**
56       * @see org.andromda.metafacades.uml.ValueObjectAssociationEnd#isValueObjectType()
57       */
58      @Override
59      protected boolean handleIsValueObjectType()
60      {
61          return this.getType() instanceof ValueObject;
62      }
63  }