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.ActionStateFacade
8    *
9    * @see org.andromda.metafacades.uml.ActionStateFacade
10   */
11  public abstract class ActionStateFacadeLogic
12      extends org.andromda.metafacades.uml14.StateFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ActionStateFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.activitygraphs.ActionState metaObject;
17  
18      public ActionStateFacadeLogic(org.omg.uml.behavioralelements.activitygraphs.ActionState 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.ActionStateFacade";
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.ActionStateFacade
50       */
51      public boolean isActionStateFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetEntry3rPreCondition()
59      {
60      }
61  
62      private void handleGetEntry3rPostCondition()
63      {
64      }
65  
66      private org.andromda.metafacades.uml.ActionFacade __getEntry3r;
67      private boolean __getEntry3rSet = false;
68  
69      public final org.andromda.metafacades.uml.ActionFacade getEntry()
70      {
71          org.andromda.metafacades.uml.ActionFacade getEntry3r = this.__getEntry3r;
72          if (!this.__getEntry3rSet)
73          {
74              handleGetEntry3rPreCondition();
75              Object result = this.shieldedElement(handleGetEntry());
76              try
77              {
78                  getEntry3r = (org.andromda.metafacades.uml.ActionFacade)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              handleGetEntry3rPostCondition();
86              this.__getEntry3r = getEntry3r;
87              if (isMetafacadePropertyCachingEnabled())
88              {
89                  this.__getEntry3rSet = true;
90              }
91          }
92          return getEntry3r;
93      }
94  
95      protected abstract java.lang.Object handleGetEntry();
96  
97      /***
98       * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
99       */
100     public void validateInvariants(java.util.Collection validationMessages)
101     {
102         super.validateInvariants(validationMessages);
103     }
104     
105     /***
106      * The property that stores the name of the metafacade.
107      */
108     private static final String NAME_PROPERTY = "name";
109     
110     /***
111      * @see java.lang.Object#toString()
112      */
113     public String toString()
114     {
115         final StringBuffer toString = new StringBuffer(this.getClass().getName());
116         toString.append("[");
117         try
118         {
119             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
120         }
121         catch (final Throwable throwable)
122         {
123             // - just ignore when the metafacade doesn't have a name property
124         }
125         toString.append("]");
126         return toString.toString();
127     }
128 }