1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.metafacades.uml14;
6
7 import java.util.Collection;
8 import org.andromda.core.metafacade.ModelValidationMessage;
9 import org.andromda.metafacades.uml.ValueObjectAssociationEnd;
10 import org.omg.uml.foundation.core.AssociationEnd;
11
12 /**
13 * Represents the association end of a ValueObject.
14 * MetafacadeLogic for ValueObjectAssociationEnd
15 *
16 * @see ValueObjectAssociationEnd
17 */
18 public abstract class ValueObjectAssociationEndLogic
19 extends AssociationEndFacadeLogicImpl
20 implements ValueObjectAssociationEnd
21 {
22 /**
23 * The underlying UML object
24 * @see Object
25 */
26 protected Object metaObject;
27
28 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
29 * @param metaObjectIn
30 * @param context
31 */
32 protected ValueObjectAssociationEndLogic(Object metaObjectIn, String context)
33 {
34 super((AssociationEnd)metaObjectIn, getContext(context));
35 this.metaObject = metaObjectIn;
36 }
37
38 /**
39 * Gets the context for this metafacade logic instance.
40 * @param context String. Set to ValueObjectAssociationEnd if null
41 * @return context String
42 */
43 private static String getContext(String context)
44 {
45 if (context == null)
46 {
47 context = "org.andromda.metafacades.uml.ValueObjectAssociationEnd";
48 }
49 return context;
50 }
51
52 /** Reset context only for non-root metafacades
53 * @param context
54 */
55 @Override
56 public void resetMetafacadeContext(String context)
57 {
58 if (!this.contextRoot) // reset context only for non-root metafacades
59 {
60 context = getContext(context); // to have same value as in original constructor call
61 setMetafacadeContext (context);
62 }
63 }
64
65 /**
66 * @return boolean true always
67 * @see ValueObjectAssociationEnd
68 */
69 public boolean isValueObjectAssociationEndMetaType()
70 {
71 return true;
72 }
73
74 // --------------- attributes ---------------------
75
76 /**
77 * @see ValueObjectAssociationEnd#isValueObjectType()
78 * @return boolean
79 */
80 protected abstract boolean handleIsValueObjectType();
81
82 private boolean __valueObjectType1a;
83 private boolean __valueObjectType1aSet = false;
84
85 /**
86 * Indicates if the type of this association is a value object or not.
87 * @return (boolean)handleIsValueObjectType()
88 */
89 public final boolean isValueObjectType()
90 {
91 boolean valueObjectType1a = this.__valueObjectType1a;
92 if (!this.__valueObjectType1aSet)
93 {
94 // valueObjectType has no pre constraints
95 valueObjectType1a = handleIsValueObjectType();
96 // valueObjectType has no post constraints
97 this.__valueObjectType1a = valueObjectType1a;
98 if (isMetafacadePropertyCachingEnabled())
99 {
100 this.__valueObjectType1aSet = true;
101 }
102 }
103 return valueObjectType1a;
104 }
105
106 /**
107 * @param validationMessages Collection<ModelValidationMessage>
108 * @see AssociationEndFacadeLogicImpl#validateInvariants(Collection validationMessages)
109 */
110 @Override
111 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
112 {
113 super.validateInvariants(validationMessages);
114 }
115 }