View Javadoc

1   package org.andromda.metafacades.uml14;
2   
3   import org.andromda.metafacades.uml.NameMasker;
4   import org.andromda.metafacades.uml.UMLMetafacadeProperties;
5   import org.apache.commons.lang.StringUtils;
6   
7   
8   /***
9    * MetafacadeLogic implementation for org.andromda.metafacades.uml.EnumerationLiteralFacade.
10   *
11   * @see org.andromda.metafacades.uml.EnumerationLiteralFacade
12   */
13  public class EnumerationLiteralFacadeLogicImpl
14      extends EnumerationLiteralFacadeLogic
15  {
16      public EnumerationLiteralFacadeLogicImpl(
17          org.omg.uml.foundation.core.EnumerationLiteral metaObject,
18          String context)
19      {
20          super(metaObject, context);
21      }
22  
23      /***
24       * @see org.andromda.metafacades.uml.ModelElementFacadeLogic#getName()
25       */
26      protected String handleGetName()
27      {
28          return this.getName(false);
29      }
30  
31      /***
32       * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getValue()
33       */
34      protected String handleGetValue()
35      {
36          return this.getValue(false);
37      }
38  
39      /***
40       * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getName(boolean)
41       */
42      protected String handleGetName(boolean modelName)
43      {
44          String name = super.handleGetName();
45          final String mask = String.valueOf(this.getConfiguredProperty(UMLMetafacadeProperties.ENUMERATION_LITERAL_NAME_MASK));
46          if (!modelName && StringUtils.isNotBlank(mask))
47          {
48              name = NameMasker.mask(name, mask);
49          }
50          return name;
51      }
52      
53      /***
54       * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getValue(boolean)
55       */
56      protected String handleGetValue(boolean modelValue)
57      {
58          return StringUtils.trimToEmpty(this.getName(modelValue));
59      }
60  }