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