1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.GeneralizationFacade
8 *
9 * @see org.andromda.metafacades.uml.GeneralizationFacade
10 */
11 public abstract class GeneralizationFacadeLogic
12 extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13 implements org.andromda.metafacades.uml.GeneralizationFacade
14 {
15
16 protected org.omg.uml.foundation.core.Generalization metaObject;
17
18 public GeneralizationFacadeLogic(org.omg.uml.foundation.core.Generalization metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.metaObject = metaObject;
22 }
23
24 /***
25 * Gets the context for this metafacade logic instance.
26 */
27 private static String getContext(String context)
28 {
29 if (context == null)
30 {
31 context = "org.andromda.metafacades.uml.GeneralizationFacade";
32 }
33 return context;
34 }
35
36 /***
37 * @see org.andromda.core.metafacade.MetafacadeBase
38 */
39 public void resetMetafacadeContext(String context)
40 {
41 if (!this.contextRoot)
42 {
43 context = getContext(context);
44 setMetafacadeContext (context);
45 }
46 }
47
48 /***
49 * @see org.andromda.metafacades.uml.GeneralizationFacade
50 */
51 public boolean isGeneralizationFacadeMetaType()
52 {
53 return true;
54 }
55
56
57
58 private void handleGetChild1rPreCondition()
59 {
60 }
61
62 private void handleGetChild1rPostCondition()
63 {
64 }
65
66 public final org.andromda.metafacades.uml.GeneralizableElementFacade getChild()
67 {
68 org.andromda.metafacades.uml.GeneralizableElementFacade getChild1r = null;
69 handleGetChild1rPreCondition();
70 Object result = this.shieldedElement(handleGetChild());
71 try
72 {
73 getChild1r = (org.andromda.metafacades.uml.GeneralizableElementFacade)result;
74 }
75 catch (ClassCastException ex)
76 {
77
78
79 }
80 handleGetChild1rPostCondition();
81 return getChild1r;
82 }
83
84 protected abstract java.lang.Object handleGetChild();
85
86 private void handleGetParent2rPreCondition()
87 {
88 }
89
90 private void handleGetParent2rPostCondition()
91 {
92 }
93
94 public final org.andromda.metafacades.uml.GeneralizableElementFacade getParent()
95 {
96 org.andromda.metafacades.uml.GeneralizableElementFacade getParent2r = null;
97 handleGetParent2rPreCondition();
98 Object result = this.shieldedElement(handleGetParent());
99 try
100 {
101 getParent2r = (org.andromda.metafacades.uml.GeneralizableElementFacade)result;
102 }
103 catch (ClassCastException ex)
104 {
105
106
107 }
108 handleGetParent2rPostCondition();
109 return getParent2r;
110 }
111
112 protected abstract java.lang.Object handleGetParent();
113
114 /***
115 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
116 */
117 public void validateInvariants(java.util.Collection validationMessages)
118 {
119 super.validateInvariants(validationMessages);
120 }
121
122 /***
123 * The property that stores the name of the metafacade.
124 */
125 private static final String NAME_PROPERTY = "name";
126
127 /***
128 * @see java.lang.Object#toString()
129 */
130 public String toString()
131 {
132 final StringBuffer toString = new StringBuffer(this.getClass().getName());
133 toString.append("[");
134 try
135 {
136 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
137 }
138 catch (final Throwable throwable)
139 {
140
141 }
142 toString.append("]");
143 return toString.toString();
144 }
145 }