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