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