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.ActorFacade
8    *
9    * @see org.andromda.metafacades.uml.ActorFacade
10   */
11  public abstract class ActorFacadeLogic
12      extends org.andromda.metafacades.uml14.ClassifierFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ActorFacade
14  {
15  
16      protected org.omg.uml.behavioralelements.usecases.Actor metaObject;
17  
18      public ActorFacadeLogic(org.omg.uml.behavioralelements.usecases.Actor 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.ActorFacade";
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.ActorFacade
50       */
51      public boolean isActorFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetGeneralizedByActors3rPreCondition()
59      {
60      }
61  
62      private void handleGetGeneralizedByActors3rPostCondition()
63      {
64      }
65  
66      private java.util.List __getGeneralizedByActors3r;
67      private boolean __getGeneralizedByActors3rSet = false;
68  
69      public final java.util.List getGeneralizedByActors()
70      {
71          java.util.List getGeneralizedByActors3r = this.__getGeneralizedByActors3r;
72          if (!this.__getGeneralizedByActors3rSet)
73          {
74              handleGetGeneralizedByActors3rPreCondition();
75              Object result = this.shieldedElements(handleGetGeneralizedByActors());
76              try
77              {
78                  getGeneralizedByActors3r = (java.util.List)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              handleGetGeneralizedByActors3rPostCondition();
86              this.__getGeneralizedByActors3r = getGeneralizedByActors3r;
87              if (isMetafacadePropertyCachingEnabled())
88              {
89                  this.__getGeneralizedByActors3rSet = true;
90              }
91          }
92          return getGeneralizedByActors3r;
93      }
94  
95      protected abstract java.util.List handleGetGeneralizedByActors();
96  
97      private void handleGetGeneralizedActors4rPreCondition()
98      {
99      }
100 
101     private void handleGetGeneralizedActors4rPostCondition()
102     {
103     }
104 
105     private java.util.List __getGeneralizedActors4r;
106     private boolean __getGeneralizedActors4rSet = false;
107 
108     public final java.util.List getGeneralizedActors()
109     {
110         java.util.List getGeneralizedActors4r = this.__getGeneralizedActors4r;
111         if (!this.__getGeneralizedActors4rSet)
112         {
113             handleGetGeneralizedActors4rPreCondition();
114             Object result = this.shieldedElements(handleGetGeneralizedActors());
115             try
116             {
117                 getGeneralizedActors4r = (java.util.List)result;
118             }
119             catch (ClassCastException ex)
120             {
121                 // ignore since the metafacade shouldn't
122                 // be set if its not of the correct type
123             }
124             handleGetGeneralizedActors4rPostCondition();
125             this.__getGeneralizedActors4r = getGeneralizedActors4r;
126             if (isMetafacadePropertyCachingEnabled())
127             {
128                 this.__getGeneralizedActors4rSet = true;
129             }
130         }
131         return getGeneralizedActors4r;
132     }
133 
134     protected abstract java.util.List handleGetGeneralizedActors();
135 
136     /***
137      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
138      */
139     public void validateInvariants(java.util.Collection validationMessages)
140     {
141         super.validateInvariants(validationMessages);
142     }
143     
144     /***
145      * The property that stores the name of the metafacade.
146      */
147     private static final String NAME_PROPERTY = "name";
148     
149     /***
150      * @see java.lang.Object#toString()
151      */
152     public String toString()
153     {
154         final StringBuffer toString = new StringBuffer(this.getClass().getName());
155         toString.append("[");
156         try
157         {
158             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
159         }
160         catch (final Throwable throwable)
161         {
162             // - just ignore when the metafacade doesn't have a name property
163         }
164         toString.append("]");
165         return toString.toString();
166     }
167 }