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.ActionFacade
8    *
9    * @see org.andromda.metafacades.uml.ActionFacade
10   */
11  public abstract class ActionFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ActionFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.commonbehavior.Action metaObject;
17  
18      public ActionFacadeLogic(org.omg.uml.behavioralelements.commonbehavior.Action 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.ActionFacade";
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.ActionFacade
50       */
51      public boolean isActionFacadeMetaType()
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 handleGetActionState2rPreCondition()
87      {
88      }
89  
90      private void handleGetActionState2rPostCondition()
91      {
92      }
93  
94      private org.andromda.metafacades.uml.ActionStateFacade __getActionState2r;
95      private boolean __getActionState2rSet = false;
96  
97      public final org.andromda.metafacades.uml.ActionStateFacade getActionState()
98      {
99          org.andromda.metafacades.uml.ActionStateFacade getActionState2r = this.__getActionState2r;
100         if (!this.__getActionState2rSet)
101         {
102             handleGetActionState2rPreCondition();
103             Object result = this.shieldedElement(handleGetActionState());
104             try
105             {
106                 getActionState2r = (org.andromda.metafacades.uml.ActionStateFacade)result;
107             }
108             catch (ClassCastException ex)
109             {
110                 // ignore since the metafacade shouldn't
111                 // be set if its not of the correct type
112             }
113             handleGetActionState2rPostCondition();
114             this.__getActionState2r = getActionState2r;
115             if (isMetafacadePropertyCachingEnabled())
116             {
117                 this.__getActionState2rSet = true;
118             }
119         }
120         return getActionState2r;
121     }
122 
123     protected abstract java.lang.Object handleGetActionState();
124 
125     /***
126      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
127      */
128     public void validateInvariants(java.util.Collection validationMessages)
129     {
130         super.validateInvariants(validationMessages);
131     }
132     
133     /***
134      * The property that stores the name of the metafacade.
135      */
136     private static final String NAME_PROPERTY = "name";
137     
138     /***
139      * @see java.lang.Object#toString()
140      */
141     public String toString()
142     {
143         final StringBuffer toString = new StringBuffer(this.getClass().getName());
144         toString.append("[");
145         try
146         {
147             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
148         }
149         catch (final Throwable throwable)
150         {
151             // - just ignore when the metafacade doesn't have a name property
152         }
153         toString.append("]");
154         return toString.toString();
155     }
156 }