View Javadoc

1   //
2   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
3   //
4   package org.andromda.metafacades.uml14;
5   
6   /***
7    * MetafacadeLogic for org.andromda.metafacades.uml.StateVertexFacade
8    *
9    * @see org.andromda.metafacades.uml.StateVertexFacade
10   */
11  public abstract class StateVertexFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.StateVertexFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.statemachines.StateVertex metaObject;
17  
18      public StateVertexFacadeLogic(org.omg.uml.behavioralelements.statemachines.StateVertex 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.StateVertexFacade";
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) // reset context only for non-root metafacades
42          {
43              context = getContext(context);  // to have same value as in original constructor call
44              setMetafacadeContext (context);
45          }
46      }
47  
48      /***
49       * @see org.andromda.metafacades.uml.StateVertexFacade
50       */
51      public boolean isStateVertexFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetOutgoing1rPreCondition()
59      {
60      }
61  
62      private void handleGetOutgoing1rPostCondition()
63      {
64      }
65  
66      public final java.util.Collection getOutgoing()
67      {
68          java.util.Collection getOutgoing1r = null;
69          handleGetOutgoing1rPreCondition();
70          Object result = this.shieldedElements(handleGetOutgoing());
71          try
72          {
73              getOutgoing1r = (java.util.Collection)result;
74          }
75          catch (ClassCastException ex)
76          {
77              // ignore since the metafacade shouldn't
78              // be set if its not of the correct type
79          }
80          handleGetOutgoing1rPostCondition();
81          return getOutgoing1r;
82      }
83  
84      protected abstract java.util.Collection handleGetOutgoing();
85  
86      private void handleGetIncoming2rPreCondition()
87      {
88      }
89  
90      private void handleGetIncoming2rPostCondition()
91      {
92      }
93  
94      public final java.util.Collection getIncoming()
95      {
96          java.util.Collection getIncoming2r = null;
97          handleGetIncoming2rPreCondition();
98          Object result = this.shieldedElements(handleGetIncoming());
99          try
100         {
101             getIncoming2r = (java.util.Collection)result;
102         }
103         catch (ClassCastException ex)
104         {
105             // ignore since the metafacade shouldn't
106             // be set if its not of the correct type
107         }
108         handleGetIncoming2rPostCondition();
109         return getIncoming2r;
110     }
111 
112     protected abstract java.util.Collection handleGetIncoming();
113 
114     private void handleGetContainer3rPreCondition()
115     {
116     }
117 
118     private void handleGetContainer3rPostCondition()
119     {
120     }
121 
122     public final org.andromda.metafacades.uml.StateFacade getContainer()
123     {
124         org.andromda.metafacades.uml.StateFacade getContainer3r = null;
125         handleGetContainer3rPreCondition();
126         Object result = this.shieldedElement(handleGetContainer());
127         try
128         {
129             getContainer3r = (org.andromda.metafacades.uml.StateFacade)result;
130         }
131         catch (ClassCastException ex)
132         {
133             // ignore since the metafacade shouldn't
134             // be set if its not of the correct type
135         }
136         handleGetContainer3rPostCondition();
137         return getContainer3r;
138     }
139 
140     protected abstract java.lang.Object handleGetContainer();
141 
142     private void handleGetPartition4rPreCondition()
143     {
144     }
145 
146     private void handleGetPartition4rPostCondition()
147     {
148     }
149 
150     private org.andromda.metafacades.uml.PartitionFacade __getPartition4r;
151     private boolean __getPartition4rSet = false;
152 
153     public final org.andromda.metafacades.uml.PartitionFacade getPartition()
154     {
155         org.andromda.metafacades.uml.PartitionFacade getPartition4r = this.__getPartition4r;
156         if (!this.__getPartition4rSet)
157         {
158             handleGetPartition4rPreCondition();
159             Object result = this.shieldedElement(handleGetPartition());
160             try
161             {
162                 getPartition4r = (org.andromda.metafacades.uml.PartitionFacade)result;
163             }
164             catch (ClassCastException ex)
165             {
166                 // ignore since the metafacade shouldn't
167                 // be set if its not of the correct type
168             }
169             handleGetPartition4rPostCondition();
170             this.__getPartition4r = getPartition4r;
171             if (isMetafacadePropertyCachingEnabled())
172             {
173                 this.__getPartition4rSet = true;
174             }
175         }
176         return getPartition4r;
177     }
178 
179     protected abstract java.lang.Object handleGetPartition();
180 
181     private void handleGetStateMachine5rPreCondition()
182     {
183     }
184 
185     private void handleGetStateMachine5rPostCondition()
186     {
187     }
188 
189     private org.andromda.metafacades.uml.StateMachineFacade __getStateMachine5r;
190     private boolean __getStateMachine5rSet = false;
191 
192     public final org.andromda.metafacades.uml.StateMachineFacade getStateMachine()
193     {
194         org.andromda.metafacades.uml.StateMachineFacade getStateMachine5r = this.__getStateMachine5r;
195         if (!this.__getStateMachine5rSet)
196         {
197             handleGetStateMachine5rPreCondition();
198             Object result = this.shieldedElement(handleGetStateMachine());
199             try
200             {
201                 getStateMachine5r = (org.andromda.metafacades.uml.StateMachineFacade)result;
202             }
203             catch (ClassCastException ex)
204             {
205                 // ignore since the metafacade shouldn't
206                 // be set if its not of the correct type
207             }
208             handleGetStateMachine5rPostCondition();
209             this.__getStateMachine5r = getStateMachine5r;
210             if (isMetafacadePropertyCachingEnabled())
211             {
212                 this.__getStateMachine5rSet = true;
213             }
214         }
215         return getStateMachine5r;
216     }
217 
218     protected abstract java.lang.Object handleGetStateMachine();
219 
220     /***
221      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
222      */
223     public void validateInvariants(java.util.Collection validationMessages)
224     {
225         super.validateInvariants(validationMessages);
226     }
227     
228     /***
229      * The property that stores the name of the metafacade.
230      */
231     private static final String NAME_PROPERTY = "name";
232     
233     /***
234      * @see java.lang.Object#toString()
235      */
236     public String toString()
237     {
238         final StringBuffer toString = new StringBuffer(this.getClass().getName());
239         toString.append("[");
240         try
241         {
242             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
243         }
244         catch (final Throwable throwable)
245         {
246             // - just ignore when the metafacade doesn't have a name property
247         }
248         toString.append("]");
249         return toString.toString();
250     }
251 }