01: package org.andromda.metafacades.emf.uml2;
02:
03: import org.andromda.metafacades.uml.Entity;
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.ManageableEntityAttribute.
10: *
11: * @see org.andromda.metafacades.uml.ManageableEntityAttribute
12: */
13: public class ManageableEntityAttributeLogicImpl extends
14: ManageableEntityAttributeLogic {
15: public ManageableEntityAttributeLogicImpl(final Object metaObject,
16: final String context) {
17: super (metaObject, context);
18: }
19:
20: /**
21: * @see org.andromda.metafacades.uml.ManageableEntityAttribute#isDisplay()
22: */
23: protected boolean handleIsDisplay() {
24: boolean display = true;
25:
26: // only identifiers might be hidden
27: if (this .isIdentifier()) {
28: final String displayStrategy = StringUtils
29: .trimToNull((String) this
30: .getConfiguredProperty(UMLMetafacadeProperties.MANAGEABLE_ID_DISPLAY_STRATEGY));
31:
32: // never display identifiers
33: if ("never".equalsIgnoreCase(displayStrategy)) {
34: display = false;
35: }
36:
37: // always display identifiers
38: else if ("always".equalsIgnoreCase(displayStrategy)) {
39: display = true;
40: }
41:
42: // only display identifiers when explicitely modeled
43: else// if ("auto".equalsIgnoreCase(displayStrategy))
44: {
45: display = ((Entity) this .getOwner())
46: .isUsingAssignedIdentifier();
47: }
48: }
49:
50: return display;
51: }
52:
53: /**
54: * @see org.andromda.metafacades.uml.ManageableEntityAttribute#isManageableGetterAvailable()
55: */
56: protected boolean handleIsManageableGetterAvailable() {
57: return this.getType() != null && this.getType().isBlobType();
58: }
59: }
|