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.DependencyFacade
8    *
9    * @see org.andromda.metafacades.uml.DependencyFacade
10   */
11  public abstract class DependencyFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.DependencyFacade
14  {
15  
16      protected org.omg.uml.foundation.core.Dependency metaObject;
17  
18      public DependencyFacadeLogic(org.omg.uml.foundation.core.Dependency 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.DependencyFacade";
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.DependencyFacade
50       */
51      public boolean isDependencyFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.DependencyFacade#getGetterName()
60      */
61      protected abstract java.lang.String handleGetGetterName();
62  
63      private void handleGetGetterName1aPreCondition()
64      {
65      }
66  
67      private void handleGetGetterName1aPostCondition()
68      {
69      }
70  
71      private java.lang.String __getterName1a;
72      private boolean __getterName1aSet = false;
73  
74      public final java.lang.String getGetterName()
75      {
76          java.lang.String getterName1a = this.__getterName1a;
77          if (!this.__getterName1aSet)
78          {
79              handleGetGetterName1aPreCondition();
80              getterName1a = handleGetGetterName();
81              handleGetGetterName1aPostCondition();
82              this.__getterName1a = getterName1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__getterName1aSet = true;
86              }
87          }
88          return getterName1a;
89      }
90  
91     /***
92      * @see org.andromda.metafacades.uml.DependencyFacade#getSetterName()
93      */
94      protected abstract java.lang.String handleGetSetterName();
95  
96      private void handleGetSetterName2aPreCondition()
97      {
98      }
99  
100     private void handleGetSetterName2aPostCondition()
101     {
102     }
103 
104     private java.lang.String __setterName2a;
105     private boolean __setterName2aSet = false;
106 
107     public final java.lang.String getSetterName()
108     {
109         java.lang.String setterName2a = this.__setterName2a;
110         if (!this.__setterName2aSet)
111         {
112             handleGetSetterName2aPreCondition();
113             setterName2a = handleGetSetterName();
114             handleGetSetterName2aPostCondition();
115             this.__setterName2a = setterName2a;
116             if (isMetafacadePropertyCachingEnabled())
117             {
118                 this.__setterName2aSet = true;
119             }
120         }
121         return setterName2a;
122     }
123 
124     // ------------- associations ------------------
125 
126     private void handleGetTargetElement1rPreCondition()
127     {
128     }
129 
130     private void handleGetTargetElement1rPostCondition()
131     {
132     }
133 
134     public final org.andromda.metafacades.uml.ModelElementFacade getTargetElement()
135     {
136         org.andromda.metafacades.uml.ModelElementFacade getTargetElement1r = null;
137         handleGetTargetElement1rPreCondition();
138         Object result = this.shieldedElement(handleGetTargetElement());
139         try
140         {
141             getTargetElement1r = (org.andromda.metafacades.uml.ModelElementFacade)result;
142         }
143         catch (ClassCastException ex)
144         {
145             // ignore since the metafacade shouldn't
146             // be set if its not of the correct type
147         }
148         handleGetTargetElement1rPostCondition();
149         return getTargetElement1r;
150     }
151 
152     protected abstract java.lang.Object handleGetTargetElement();
153 
154     private void handleGetSourceElement5rPreCondition()
155     {
156     }
157 
158     private void handleGetSourceElement5rPostCondition()
159     {
160     }
161 
162     public final org.andromda.metafacades.uml.ModelElementFacade getSourceElement()
163     {
164         org.andromda.metafacades.uml.ModelElementFacade getSourceElement5r = null;
165         handleGetSourceElement5rPreCondition();
166         Object result = this.shieldedElement(handleGetSourceElement());
167         try
168         {
169             getSourceElement5r = (org.andromda.metafacades.uml.ModelElementFacade)result;
170         }
171         catch (ClassCastException ex)
172         {
173             // ignore since the metafacade shouldn't
174             // be set if its not of the correct type
175         }
176         handleGetSourceElement5rPostCondition();
177         return getSourceElement5r;
178     }
179 
180     protected abstract java.lang.Object handleGetSourceElement();
181 
182     /***
183      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
184      */
185     public void validateInvariants(java.util.Collection validationMessages)
186     {
187         super.validateInvariants(validationMessages);
188     }
189     
190     /***
191      * The property that stores the name of the metafacade.
192      */
193     private static final String NAME_PROPERTY = "name";
194     
195     /***
196      * @see java.lang.Object#toString()
197      */
198     public String toString()
199     {
200         final StringBuffer toString = new StringBuffer(this.getClass().getName());
201         toString.append("[");
202         try
203         {
204             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
205         }
206         catch (final Throwable throwable)
207         {
208             // - just ignore when the metafacade doesn't have a name property
209         }
210         toString.append("]");
211         return toString.toString();
212     }
213 }