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.FrontEndEvent
8    *
9    * @see org.andromda.metafacades.uml.FrontEndEvent
10   */
11  public abstract class FrontEndEventLogic
12      extends org.andromda.metafacades.uml14.EventFacadeLogicImpl
13      implements org.andromda.metafacades.uml.FrontEndEvent
14  {
15  
16      protected Object metaObject;
17  
18      public FrontEndEventLogic(Object metaObject, String context)
19      {
20          super((org.omg.uml.behavioralelements.statemachines.Event)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.FrontEndEvent";
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.FrontEndEvent
50       */
51      public boolean isFrontEndEventMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.FrontEndEvent#isContainedInFrontEndUseCase()
60      */
61      protected abstract boolean handleIsContainedInFrontEndUseCase();
62  
63      private void handleIsContainedInFrontEndUseCase1aPreCondition()
64      {
65      }
66  
67      private void handleIsContainedInFrontEndUseCase1aPostCondition()
68      {
69      }
70  
71      private boolean __containedInFrontEndUseCase1a;
72      private boolean __containedInFrontEndUseCase1aSet = false;
73  
74      public final boolean isContainedInFrontEndUseCase()
75      {
76          boolean containedInFrontEndUseCase1a = this.__containedInFrontEndUseCase1a;
77          if (!this.__containedInFrontEndUseCase1aSet)
78          {
79              handleIsContainedInFrontEndUseCase1aPreCondition();
80              containedInFrontEndUseCase1a = handleIsContainedInFrontEndUseCase();
81              handleIsContainedInFrontEndUseCase1aPostCondition();
82              this.__containedInFrontEndUseCase1a = containedInFrontEndUseCase1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__containedInFrontEndUseCase1aSet = true;
86              }
87          }
88          return containedInFrontEndUseCase1a;
89      }
90  
91      // ------------- associations ------------------
92  
93      private void handleGetControllerCall1rPreCondition()
94      {
95      }
96  
97      private void handleGetControllerCall1rPostCondition()
98      {
99      }
100 
101     private org.andromda.metafacades.uml.FrontEndControllerOperation __getControllerCall1r;
102     private boolean __getControllerCall1rSet = false;
103 
104     public final org.andromda.metafacades.uml.FrontEndControllerOperation getControllerCall()
105     {
106         org.andromda.metafacades.uml.FrontEndControllerOperation getControllerCall1r = this.__getControllerCall1r;
107         if (!this.__getControllerCall1rSet)
108         {
109             handleGetControllerCall1rPreCondition();
110             Object result = this.shieldedElement(handleGetControllerCall());
111             try
112             {
113                 getControllerCall1r = (org.andromda.metafacades.uml.FrontEndControllerOperation)result;
114             }
115             catch (ClassCastException ex)
116             {
117                 // ignore since the metafacade shouldn't
118                 // be set if its not of the correct type
119             }
120             handleGetControllerCall1rPostCondition();
121             this.__getControllerCall1r = getControllerCall1r;
122             if (isMetafacadePropertyCachingEnabled())
123             {
124                 this.__getControllerCall1rSet = true;
125             }
126         }
127         return getControllerCall1r;
128     }
129 
130     protected abstract java.lang.Object handleGetControllerCall();
131 
132     private void handleGetAction2rPreCondition()
133     {
134     }
135 
136     private void handleGetAction2rPostCondition()
137     {
138     }
139 
140     private org.andromda.metafacades.uml.FrontEndAction __getAction2r;
141     private boolean __getAction2rSet = false;
142 
143     public final org.andromda.metafacades.uml.FrontEndAction getAction()
144     {
145         org.andromda.metafacades.uml.FrontEndAction getAction2r = this.__getAction2r;
146         if (!this.__getAction2rSet)
147         {
148             handleGetAction2rPreCondition();
149             Object result = this.shieldedElement(handleGetAction());
150             try
151             {
152                 getAction2r = (org.andromda.metafacades.uml.FrontEndAction)result;
153             }
154             catch (ClassCastException ex)
155             {
156                 // ignore since the metafacade shouldn't
157                 // be set if its not of the correct type
158             }
159             handleGetAction2rPostCondition();
160             this.__getAction2r = getAction2r;
161             if (isMetafacadePropertyCachingEnabled())
162             {
163                 this.__getAction2rSet = true;
164             }
165         }
166         return getAction2r;
167     }
168 
169     protected abstract java.lang.Object handleGetAction();
170 
171     private void handleGetControllerCalls4rPreCondition()
172     {
173     }
174 
175     private void handleGetControllerCalls4rPostCondition()
176     {
177     }
178 
179     public final java.util.List getControllerCalls()
180     {
181         java.util.List getControllerCalls4r = null;
182         handleGetControllerCalls4rPreCondition();
183         Object result = this.shieldedElements(handleGetControllerCalls());
184         try
185         {
186             getControllerCalls4r = (java.util.List)result;
187         }
188         catch (ClassCastException ex)
189         {
190             // ignore since the metafacade shouldn't
191             // be set if its not of the correct type
192         }
193         handleGetControllerCalls4rPostCondition();
194         return getControllerCalls4r;
195     }
196 
197     protected abstract java.util.List handleGetControllerCalls();
198 
199     /***
200      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
201      */
202     public void validateInvariants(java.util.Collection validationMessages)
203     {
204         super.validateInvariants(validationMessages);
205     }
206     
207     /***
208      * The property that stores the name of the metafacade.
209      */
210     private static final String NAME_PROPERTY = "name";
211     
212     /***
213      * @see java.lang.Object#toString()
214      */
215     public String toString()
216     {
217         final StringBuffer toString = new StringBuffer(this.getClass().getName());
218         toString.append("[");
219         try
220         {
221             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
222         }
223         catch (final Throwable throwable)
224         {
225             // - just ignore when the metafacade doesn't have a name property
226         }
227         toString.append("]");
228         return toString.toString();
229     }
230 }