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