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.ExtendFacade
8    *
9    * @see org.andromda.metafacades.uml.ExtendFacade
10   */
11  public abstract class ExtendFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ExtendFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.usecases.Extend metaObject;
17  
18      public ExtendFacadeLogic(org.omg.uml.behavioralelements.usecases.Extend 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.ExtendFacade";
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.ExtendFacade
50       */
51      public boolean isExtendFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetBase1rPreCondition()
59      {
60      }
61  
62      private void handleGetBase1rPostCondition()
63      {
64      }
65  
66      private org.andromda.metafacades.uml.UseCaseFacade __getBase1r;
67      private boolean __getBase1rSet = false;
68  
69      public final org.andromda.metafacades.uml.UseCaseFacade getBase()
70      {
71          org.andromda.metafacades.uml.UseCaseFacade getBase1r = this.__getBase1r;
72          if (!this.__getBase1rSet)
73          {
74              handleGetBase1rPreCondition();
75              Object result = this.shieldedElement(handleGetBase());
76              try
77              {
78                  getBase1r = (org.andromda.metafacades.uml.UseCaseFacade)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              handleGetBase1rPostCondition();
86              this.__getBase1r = getBase1r;
87              if (isMetafacadePropertyCachingEnabled())
88              {
89                  this.__getBase1rSet = true;
90              }
91          }
92          return getBase1r;
93      }
94  
95      protected abstract java.lang.Object handleGetBase();
96  
97      private void handleGetExtensionPoints2rPreCondition()
98      {
99      }
100 
101     private void handleGetExtensionPoints2rPostCondition()
102     {
103     }
104 
105     private java.util.List __getExtensionPoints2r;
106     private boolean __getExtensionPoints2rSet = false;
107 
108     public final java.util.List getExtensionPoints()
109     {
110         java.util.List getExtensionPoints2r = this.__getExtensionPoints2r;
111         if (!this.__getExtensionPoints2rSet)
112         {
113             handleGetExtensionPoints2rPreCondition();
114             Object result = this.shieldedElements(handleGetExtensionPoints());
115             try
116             {
117                 getExtensionPoints2r = (java.util.List)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             handleGetExtensionPoints2rPostCondition();
125             this.__getExtensionPoints2r = getExtensionPoints2r;
126             if (isMetafacadePropertyCachingEnabled())
127             {
128                 this.__getExtensionPoints2rSet = true;
129             }
130         }
131         return getExtensionPoints2r;
132     }
133 
134     protected abstract java.util.List handleGetExtensionPoints();
135 
136     private void handleGetExtension3rPreCondition()
137     {
138     }
139 
140     private void handleGetExtension3rPostCondition()
141     {
142     }
143 
144     private org.andromda.metafacades.uml.UseCaseFacade __getExtension3r;
145     private boolean __getExtension3rSet = false;
146 
147     public final org.andromda.metafacades.uml.UseCaseFacade getExtension()
148     {
149         org.andromda.metafacades.uml.UseCaseFacade getExtension3r = this.__getExtension3r;
150         if (!this.__getExtension3rSet)
151         {
152             handleGetExtension3rPreCondition();
153             Object result = this.shieldedElement(handleGetExtension());
154             try
155             {
156                 getExtension3r = (org.andromda.metafacades.uml.UseCaseFacade)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             handleGetExtension3rPostCondition();
164             this.__getExtension3r = getExtension3r;
165             if (isMetafacadePropertyCachingEnabled())
166             {
167                 this.__getExtension3rSet = true;
168             }
169         }
170         return getExtension3r;
171     }
172 
173     protected abstract java.lang.Object handleGetExtension();
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     
183     /***
184      * The property that stores the name of the metafacade.
185      */
186     private static final String NAME_PROPERTY = "name";
187     
188     /***
189      * @see java.lang.Object#toString()
190      */
191     public String toString()
192     {
193         final StringBuffer toString = new StringBuffer(this.getClass().getName());
194         toString.append("[");
195         try
196         {
197             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
198         }
199         catch (final Throwable throwable)
200         {
201             // - just ignore when the metafacade doesn't have a name property
202         }
203         toString.append("]");
204         return toString.toString();
205     }
206 }