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.PartitionFacade
8    *
9    * @see org.andromda.metafacades.uml.PartitionFacade
10   */
11  public abstract class PartitionFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.PartitionFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.activitygraphs.Partition metaObject;
17  
18      public PartitionFacadeLogic(org.omg.uml.behavioralelements.activitygraphs.Partition 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.PartitionFacade";
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.PartitionFacade
50       */
51      public boolean isPartitionFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetActivityGraph1rPreCondition()
59      {
60      }
61  
62      private void handleGetActivityGraph1rPostCondition()
63      {
64      }
65  
66      public final org.andromda.metafacades.uml.ActivityGraphFacade getActivityGraph()
67      {
68          org.andromda.metafacades.uml.ActivityGraphFacade getActivityGraph1r = null;
69          handleGetActivityGraph1rPreCondition();
70          Object result = this.shieldedElement(handleGetActivityGraph());
71          try
72          {
73              getActivityGraph1r = (org.andromda.metafacades.uml.ActivityGraphFacade)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          handleGetActivityGraph1rPostCondition();
81          return getActivityGraph1r;
82      }
83  
84      protected abstract java.lang.Object handleGetActivityGraph();
85  
86      private void handleGetVertices2rPreCondition()
87      {
88      }
89  
90      private void handleGetVertices2rPostCondition()
91      {
92      }
93  
94      private java.util.Collection __getVertices2r;
95      private boolean __getVertices2rSet = false;
96  
97      public final java.util.Collection getVertices()
98      {
99          java.util.Collection getVertices2r = this.__getVertices2r;
100         if (!this.__getVertices2rSet)
101         {
102             handleGetVertices2rPreCondition();
103             Object result = this.shieldedElements(handleGetVertices());
104             try
105             {
106                 getVertices2r = (java.util.Collection)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             handleGetVertices2rPostCondition();
114             this.__getVertices2r = getVertices2r;
115             if (isMetafacadePropertyCachingEnabled())
116             {
117                 this.__getVertices2rSet = true;
118             }
119         }
120         return getVertices2r;
121     }
122 
123     protected abstract java.util.Collection handleGetVertices();
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 }