View Javadoc

1   package org.andromda.cartridges.spring.metafacades;
2   
3   import org.apache.commons.lang.StringUtils;
4   
5   /***
6    * MetafacadeLogic implementation for org.andromda.cartridges.spring.metafacades.SpringEntityOperation.
7    *
8    * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation
9    */
10  public class SpringEntityOperationLogicImpl
11          extends SpringEntityOperationLogic
12  {
13      
14      public SpringEntityOperationLogicImpl(Object metaObject, String context)
15      {
16          super(metaObject, context);
17      }
18  
19      /***
20       * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationName()
21       */
22      protected java.lang.String handleGetImplementationName()
23      {
24          return this.getImplementationOperationName(StringUtils.capitalize(this.getName()));
25      }
26  
27      /***
28       * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationCall()
29       */
30      protected java.lang.String handleGetImplementationCall()
31      {
32          return this.getImplementationOperationName(StringUtils.capitalize(this.getCall()));
33      }
34  
35      /***
36       * @see org.andromda.cartridges.spring.metafacades.SpringEntityOperation#getImplementationSignature()
37       */
38      protected java.lang.String handleGetImplementationSignature()
39      {
40          return this.getImplementationOperationName(StringUtils.capitalize(this.getSignature()));
41      }
42  
43      /***
44       * Retrieves the implementationOperatName by replacing the <code>replacement</code> in the {@link
45       * SpringGlobals#IMPLEMENTATION_OPERATION_NAME_PATTERN}
46       *
47       * @param replacement the replacement string for the pattern.
48       * @return the operation name
49       */
50      private String getImplementationOperationName(String replacement)
51      {
52          return StringUtils.trimToEmpty(String.valueOf(this.getConfiguredProperty(
53                  SpringGlobals.IMPLEMENTATION_OPERATION_NAME_PATTERN))).replaceAll("//{0//}", replacement);
54      }
55  
56  }