View Javadoc
1   package org.andromda.cartridges.spring.metafacades;
2   
3   import org.andromda.utils.StringUtilsHelper;
4   import org.apache.commons.lang.StringUtils;
5   
6   /**
7    * MetafacadeLogic implementation for org.andromda.cartridges.spring.metafacades.SpringTopic.
8    *
9    * @see org.andromda.cartridges.spring.metafacades.SpringTopic
10   */
11  public class SpringTopicLogicImpl
12      extends SpringTopicLogic
13  {
14      private static final long serialVersionUID = 34L;
15      /**
16       * Public constructor for SpringTopicLogicImpl
17       * @param metaObject
18       * @param context
19       * @see org.andromda.cartridges.spring.metafacades.SpringTopic
20       */
21      public SpringTopicLogicImpl (Object metaObject, String context)
22      {
23          super (metaObject, context);
24      }
25  
26      /**
27       * @return lowerCamelCaseName(this.getName())
28       * @see org.andromda.cartridges.spring.metafacades.SpringTopic#getBeanName()
29       */
30      protected String handleGetBeanName()
31      {
32          return StringUtilsHelper.lowerCamelCaseName(this.getName());
33      }
34  
35      /**
36       * @return lowerCamelCaseName(this.getTemplatePattern().replaceAll("\\{0\\}", getName()))
37       * @see org.andromda.cartridges.spring.metafacades.SpringTopic#getTemplateBeanName()
38       */
39      protected String handleGetTemplateBeanName()
40      {
41          return StringUtilsHelper.lowerCamelCaseName(this.getTemplatePattern().replaceAll(
42              "\\{0\\}",
43              this.getName()));
44      }
45  
46      /**
47       * @return "get" + StringUtilsHelper.capitalize(this.getTemplateBeanName())
48       * @see org.andromda.cartridges.spring.metafacades.SpringTopic#getTemplateGetterName()
49       */
50      protected String handleGetTemplateGetterName()
51      {
52          return "get" + StringUtils.capitalize(this.getTemplateBeanName());
53      }
54  
55      /**
56       * @return "set" + StringUtilsHelper.capitalize(this.getTemplateBeanName())
57       * @see org.andromda.cartridges.spring.metafacades.SpringTopic#getTemplateSetterName()
58       */
59      protected String handleGetTemplateSetterName()
60      {
61          return "set" + StringUtils.capitalize(this.getTemplateBeanName());
62      }
63  
64      /**
65       * Gets the value of the {@link SpringGlobals#JMS_DESTINATION_TEMPLATE_PATTERN}
66       *
67       * @return the template name pattern.
68       */
69      private String getTemplatePattern()
70      {
71          return String.valueOf(this.getConfiguredProperty(SpringGlobals.JMS_DESTINATION_TEMPLATE_PATTERN));
72      }
73  
74  }