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.AttributeLinkFacade
8    *
9    * @see org.andromda.metafacades.uml.AttributeLinkFacade
10   */
11  public abstract class AttributeLinkFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.AttributeLinkFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.commonbehavior.AttributeLink metaObject;
17  
18      public AttributeLinkFacadeLogic(org.omg.uml.behavioralelements.commonbehavior.AttributeLink 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.AttributeLinkFacade";
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.AttributeLinkFacade
50       */
51      public boolean isAttributeLinkFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetAttribute1rPreCondition()
59      {
60      }
61  
62      private void handleGetAttribute1rPostCondition()
63      {
64      }
65  
66      private org.andromda.metafacades.uml.AttributeFacade __getAttribute1r;
67      private boolean __getAttribute1rSet = false;
68  
69      public final org.andromda.metafacades.uml.AttributeFacade getAttribute()
70      {
71          org.andromda.metafacades.uml.AttributeFacade getAttribute1r = this.__getAttribute1r;
72          if (!this.__getAttribute1rSet)
73          {
74              handleGetAttribute1rPreCondition();
75              Object result = this.shieldedElement(handleGetAttribute());
76              try
77              {
78                  getAttribute1r = (org.andromda.metafacades.uml.AttributeFacade)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              handleGetAttribute1rPostCondition();
86              this.__getAttribute1r = getAttribute1r;
87              if (isMetafacadePropertyCachingEnabled())
88              {
89                  this.__getAttribute1rSet = true;
90              }
91          }
92          return getAttribute1r;
93      }
94  
95      protected abstract java.lang.Object handleGetAttribute();
96  
97      private void handleGetInstance2rPreCondition()
98      {
99      }
100 
101     private void handleGetInstance2rPostCondition()
102     {
103     }
104 
105     private org.andromda.metafacades.uml.InstanceFacade __getInstance2r;
106     private boolean __getInstance2rSet = false;
107 
108     public final org.andromda.metafacades.uml.InstanceFacade getInstance()
109     {
110         org.andromda.metafacades.uml.InstanceFacade getInstance2r = this.__getInstance2r;
111         if (!this.__getInstance2rSet)
112         {
113             handleGetInstance2rPreCondition();
114             Object result = this.shieldedElement(handleGetInstance());
115             try
116             {
117                 getInstance2r = (org.andromda.metafacades.uml.InstanceFacade)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             handleGetInstance2rPostCondition();
125             this.__getInstance2r = getInstance2r;
126             if (isMetafacadePropertyCachingEnabled())
127             {
128                 this.__getInstance2rSet = true;
129             }
130         }
131         return getInstance2r;
132     }
133 
134     protected abstract java.lang.Object handleGetInstance();
135 
136     private void handleGetValue3rPreCondition()
137     {
138     }
139 
140     private void handleGetValue3rPostCondition()
141     {
142     }
143 
144     private org.andromda.metafacades.uml.InstanceFacade __getValue3r;
145     private boolean __getValue3rSet = false;
146 
147     public final org.andromda.metafacades.uml.InstanceFacade getValue()
148     {
149         org.andromda.metafacades.uml.InstanceFacade getValue3r = this.__getValue3r;
150         if (!this.__getValue3rSet)
151         {
152             handleGetValue3rPreCondition();
153             Object result = this.shieldedElement(handleGetValue());
154             try
155             {
156                 getValue3r = (org.andromda.metafacades.uml.InstanceFacade)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             handleGetValue3rPostCondition();
164             this.__getValue3r = getValue3r;
165             if (isMetafacadePropertyCachingEnabled())
166             {
167                 this.__getValue3rSet = true;
168             }
169         }
170         return getValue3r;
171     }
172 
173     protected abstract java.lang.Object handleGetValue();
174 
175     private void handleGetValues4rPreCondition()
176     {
177     }
178 
179     private void handleGetValues4rPostCondition()
180     {
181     }
182 
183     private java.util.Collection __getValues4r;
184     private boolean __getValues4rSet = false;
185 
186     public final java.util.Collection getValues()
187     {
188         java.util.Collection getValues4r = this.__getValues4r;
189         if (!this.__getValues4rSet)
190         {
191             handleGetValues4rPreCondition();
192             Object result = this.shieldedElements(handleGetValues());
193             try
194             {
195                 getValues4r = (java.util.Collection)result;
196             }
197             catch (ClassCastException ex)
198             {
199                 // ignore since the metafacade shouldn't
200                 // be set if its not of the correct type
201             }
202             handleGetValues4rPostCondition();
203             this.__getValues4r = getValues4r;
204             if (isMetafacadePropertyCachingEnabled())
205             {
206                 this.__getValues4rSet = true;
207             }
208         }
209         return getValues4r;
210     }
211 
212     protected abstract java.util.Collection handleGetValues();
213 
214     /***
215      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
216      */
217     public void validateInvariants(java.util.Collection validationMessages)
218     {
219         super.validateInvariants(validationMessages);
220     }
221     
222     /***
223      * The property that stores the name of the metafacade.
224      */
225     private static final String NAME_PROPERTY = "name";
226     
227     /***
228      * @see java.lang.Object#toString()
229      */
230     public String toString()
231     {
232         final StringBuffer toString = new StringBuffer(this.getClass().getName());
233         toString.append("[");
234         try
235         {
236             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
237         }
238         catch (final Throwable throwable)
239         {
240             // - just ignore when the metafacade doesn't have a name property
241         }
242         toString.append("]");
243         return toString.toString();
244     }
245 }