01: package org.andromda.metafacades.emf.uml2;
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
09: * org.andromda.metafacades.uml.EnumerationLiteralFacade.
10: *
11: * @see org.andromda.metafacades.uml.EnumerationLiteralFacade
12: */
13: public class EnumerationLiteralFacadeLogicImpl extends
14: EnumerationLiteralFacadeLogic {
15: public EnumerationLiteralFacadeLogicImpl(
16: final org.eclipse.uml2.EnumerationLiteral metaObject,
17: final String context) {
18: super (metaObject, context);
19: }
20:
21: /**
22: * @see org.andromda.metafacades.emf.uml2.ModelElementFacadeLogic#handleGetName()
23: */
24: protected String handleGetName() {
25: return this .getName(false);
26: }
27:
28: /**
29: * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getValue()
30: */
31: protected String handleGetValue() {
32: return this .getValue(false);
33: }
34:
35: /**
36: * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getName(boolean)
37: */
38: protected String handleGetName(boolean modelName) {
39: String name = super .handleGetName();
40: final String mask = String
41: .valueOf(this
42: .getConfiguredProperty(UMLMetafacadeProperties.ENUMERATION_LITERAL_NAME_MASK));
43: if (!modelName && StringUtils.isNotBlank(mask)) {
44: name = NameMasker.mask(name, mask);
45: }
46: return name;
47: }
48:
49: /**
50: * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getValue(boolean)
51: */
52: protected String handleGetValue(boolean modelValue) {
53: return StringUtils.trimToEmpty(this.getName(modelValue));
54: }
55: }
|