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.FrontEndController
8    *
9    * @see org.andromda.metafacades.uml.FrontEndController
10   */
11  public abstract class FrontEndControllerLogic
12      extends org.andromda.metafacades.uml14.ClassifierFacadeLogicImpl
13      implements org.andromda.metafacades.uml.FrontEndController
14  {
15  
16      protected Object metaObject;
17  
18      public FrontEndControllerLogic(Object metaObject, String context)
19      {
20          super((org.omg.uml.foundation.core.Classifier)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.FrontEndController";
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.FrontEndController
50       */
51      public boolean isFrontEndControllerMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetServiceReferences1rPreCondition()
59      {
60      }
61  
62      private void handleGetServiceReferences1rPostCondition()
63      {
64      }
65  
66      private java.util.List __getServiceReferences1r;
67      private boolean __getServiceReferences1rSet = false;
68  
69      public final java.util.List getServiceReferences()
70      {
71          java.util.List getServiceReferences1r = this.__getServiceReferences1r;
72          if (!this.__getServiceReferences1rSet)
73          {
74              handleGetServiceReferences1rPreCondition();
75              Object result = this.shieldedElements(handleGetServiceReferences());
76              try
77              {
78                  getServiceReferences1r = (java.util.List)result;
79              }
80              catch (ClassCastException ex)
81              {
82                  // ignore since the metafacade shouldn't
83                  // be set if its not of the correct type
84              }
85              handleGetServiceReferences1rPostCondition();
86              this.__getServiceReferences1r = getServiceReferences1r;
87              if (isMetafacadePropertyCachingEnabled())
88              {
89                  this.__getServiceReferences1rSet = true;
90              }
91          }
92          return getServiceReferences1r;
93      }
94  
95      protected abstract java.util.List handleGetServiceReferences();
96  
97      private void handleGetUseCase2rPreCondition()
98      {
99      }
100 
101     private void handleGetUseCase2rPostCondition()
102     {
103     }
104 
105     private org.andromda.metafacades.uml.FrontEndUseCase __getUseCase2r;
106     private boolean __getUseCase2rSet = false;
107 
108     public final org.andromda.metafacades.uml.FrontEndUseCase getUseCase()
109     {
110         org.andromda.metafacades.uml.FrontEndUseCase getUseCase2r = this.__getUseCase2r;
111         if (!this.__getUseCase2rSet)
112         {
113             handleGetUseCase2rPreCondition();
114             Object result = this.shieldedElement(handleGetUseCase());
115             try
116             {
117                 getUseCase2r = (org.andromda.metafacades.uml.FrontEndUseCase)result;
118             }
119             catch (ClassCastException ex)
120             {
121                 // ignore since the metafacade shouldn't
122                 // be set if its not of the correct type
123             }
124             handleGetUseCase2rPostCondition();
125             this.__getUseCase2r = getUseCase2r;
126             if (isMetafacadePropertyCachingEnabled())
127             {
128                 this.__getUseCase2rSet = true;
129             }
130         }
131         return getUseCase2r;
132     }
133 
134     protected abstract java.lang.Object handleGetUseCase();
135 
136     private void handleGetDeferringActions5rPreCondition()
137     {
138     }
139 
140     private void handleGetDeferringActions5rPostCondition()
141     {
142     }
143 
144     private java.util.List __getDeferringActions5r;
145     private boolean __getDeferringActions5rSet = false;
146 
147     public final java.util.List getDeferringActions()
148     {
149         java.util.List getDeferringActions5r = this.__getDeferringActions5r;
150         if (!this.__getDeferringActions5rSet)
151         {
152             handleGetDeferringActions5rPreCondition();
153             Object result = this.shieldedElements(handleGetDeferringActions());
154             try
155             {
156                 getDeferringActions5r = (java.util.List)result;
157             }
158             catch (ClassCastException ex)
159             {
160                 // ignore since the metafacade shouldn't
161                 // be set if its not of the correct type
162             }
163             handleGetDeferringActions5rPostCondition();
164             this.__getDeferringActions5r = getDeferringActions5r;
165             if (isMetafacadePropertyCachingEnabled())
166             {
167                 this.__getDeferringActions5rSet = true;
168             }
169         }
170         return getDeferringActions5r;
171     }
172 
173     protected abstract java.util.List handleGetDeferringActions();
174 
175     /***
176      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
177      */
178     public void validateInvariants(java.util.Collection validationMessages)
179     {
180         super.validateInvariants(validationMessages);
181         {
182             final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLCollections.notEmpty(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"packageName"))); 
183             if (!constraintValid)
184                 validationMessages.add(
185                     new org.andromda.core.metafacade.ModelValidationMessage(
186                         (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
187                         "org::andromda::metafacades::uml::FrontEndController::front-end controllers need a package",
188                         "Each front-end controller is required to be modeled in a package, doing otherwise will result in uncompileable code due to filename collisions."));
189         }
190     }
191     
192     /***
193      * The property that stores the name of the metafacade.
194      */
195     private static final String NAME_PROPERTY = "name";
196     
197     /***
198      * @see java.lang.Object#toString()
199      */
200     public String toString()
201     {
202         final StringBuffer toString = new StringBuffer(this.getClass().getName());
203         toString.append("[");
204         try
205         {
206             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
207         }
208         catch (final Throwable throwable)
209         {
210             // - just ignore when the metafacade doesn't have a name property
211         }
212         toString.append("]");
213         return toString.toString();
214     }
215 }