View Javadoc
1   package org.andromda.cartridges.jsf2.metafacades;
2   
3   import org.andromda.cartridges.jsf2.JSFGlobals;
4   import org.andromda.utils.StringUtilsHelper;
5   import org.apache.commons.lang.ObjectUtils;
6   import org.apache.commons.lang.StringUtils;
7   
8   /**
9    * MetafacadeLogic implementation for org.andromda.cartridges.jsf2.metafacades.JSFEnumeration.
10   *
11   * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration
12   */
13  public class JSFEnumerationLogicImpl
14      extends JSFEnumerationLogic
15  {
16      private static final long serialVersionUID = 34L;
17      /**
18       * @param metaObject
19       * @param context
20       */
21      public JSFEnumerationLogicImpl(Object metaObject, String context)
22      {
23          super(metaObject, context);
24      }
25  
26      /**
27       * @return converterName
28       * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration#getConverterName()
29       */
30      protected String handleGetConverterName()
31      {
32          return StringUtils.replace(
33              ObjectUtils.toString(this.getConfiguredProperty(JSFGlobals.CONVERTER_PATTERN)),
34              "{0}",
35              this.getName());
36      }
37  
38      /**
39       * @return getPackageName() + "." + getConverterName()
40       * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration#getFullyQualifiedConverterName()
41       */
42      protected String handleGetFullyQualifiedConverterName()
43      {
44          return this.getPackageName() + "." + this.getConverterName();
45      }
46  
47      /**
48       * @return getFullyQualifiedConverterName().replace('.', '/')
49       * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration#getConverterPath()
50       */
51      protected String handleGetConverterPath()
52      {
53          return this.getFullyQualifiedConverterName().replace('.', '/');
54      }
55  
56      /**
57       * @return StringUtilsHelper.toResourceMessageKey(getName())
58       * @see org.andromda.cartridges.jsf2.metafacades.JSFEnumeration#getMessageKey()
59       */
60      protected String handleGetMessageKey()
61      {
62          return StringUtilsHelper.toResourceMessageKey(getName());
63      }
64  }