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.EventFacade
8    *
9    * @see org.andromda.metafacades.uml.EventFacade
10   */
11  public abstract class EventFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.EventFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.statemachines.Event metaObject;
17  
18      public EventFacadeLogic(org.omg.uml.behavioralelements.statemachines.Event 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.EventFacade";
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.EventFacade
50       */
51      public boolean isEventFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetTransition1rPreCondition()
59      {
60      }
61  
62      private void handleGetTransition1rPostCondition()
63      {
64      }
65  
66      public final org.andromda.metafacades.uml.TransitionFacade getTransition()
67      {
68          org.andromda.metafacades.uml.TransitionFacade getTransition1r = null;
69          handleGetTransition1rPreCondition();
70          Object result = this.shieldedElement(handleGetTransition());
71          try
72          {
73              getTransition1r = (org.andromda.metafacades.uml.TransitionFacade)result;
74          }
75          catch (ClassCastException ex)
76          {
77              // ignore since the metafacade shouldn't
78              // be set if its not of the correct type
79          }
80          handleGetTransition1rPostCondition();
81          return getTransition1r;
82      }
83  
84      protected abstract java.lang.Object handleGetTransition();
85  
86      private void handleGetParameters2rPreCondition()
87      {
88      }
89  
90      private void handleGetParameters2rPostCondition()
91      {
92      }
93  
94      public final java.util.Collection getParameters()
95      {
96          java.util.Collection getParameters2r = null;
97          handleGetParameters2rPreCondition();
98          Object result = this.shieldedElements(handleGetParameters());
99          try
100         {
101             getParameters2r = (java.util.Collection)result;
102         }
103         catch (ClassCastException ex)
104         {
105             // ignore since the metafacade shouldn't
106             // be set if its not of the correct type
107         }
108         handleGetParameters2rPostCondition();
109         return getParameters2r;
110     }
111 
112     protected abstract java.util.Collection handleGetParameters();
113 
114     private void handleGetState3rPreCondition()
115     {
116     }
117 
118     private void handleGetState3rPostCondition()
119     {
120     }
121 
122     public final org.andromda.metafacades.uml.StateFacade getState()
123     {
124         org.andromda.metafacades.uml.StateFacade getState3r = null;
125         handleGetState3rPreCondition();
126         Object result = this.shieldedElement(handleGetState());
127         try
128         {
129             getState3r = (org.andromda.metafacades.uml.StateFacade)result;
130         }
131         catch (ClassCastException ex)
132         {
133             // ignore since the metafacade shouldn't
134             // be set if its not of the correct type
135         }
136         handleGetState3rPostCondition();
137         return getState3r;
138     }
139 
140     protected abstract java.lang.Object handleGetState();
141 
142     /***
143      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
144      */
145     public void validateInvariants(java.util.Collection validationMessages)
146     {
147         super.validateInvariants(validationMessages);
148     }
149     
150     /***
151      * The property that stores the name of the metafacade.
152      */
153     private static final String NAME_PROPERTY = "name";
154     
155     /***
156      * @see java.lang.Object#toString()
157      */
158     public String toString()
159     {
160         final StringBuffer toString = new StringBuffer(this.getClass().getName());
161         toString.append("[");
162         try
163         {
164             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
165         }
166         catch (final Throwable throwable)
167         {
168             // - just ignore when the metafacade doesn't have a name property
169         }
170         toString.append("]");
171         return toString.toString();
172     }
173 }