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.ServiceOperation
8    *
9    * @see org.andromda.metafacades.uml.ServiceOperation
10   */
11  public abstract class ServiceOperationLogic
12      extends org.andromda.metafacades.uml14.OperationFacadeLogicImpl
13      implements org.andromda.metafacades.uml.ServiceOperation
14  {
15  
16      protected Object metaObject;
17  
18      public ServiceOperationLogic(Object metaObject, String context)
19      {
20          super((org.omg.uml.foundation.core.Operation)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.ServiceOperation";
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.ServiceOperation
50       */
51      public boolean isServiceOperationMetaType()
52      {
53          return true;
54      }
55      
56      // ------------- associations ------------------
57  
58      private void handleGetRoles1rPreCondition()
59      {
60      }
61  
62      private void handleGetRoles1rPostCondition()
63      {
64      }
65  
66      public final java.util.Collection getRoles()
67      {
68          java.util.Collection getRoles1r = null;
69          handleGetRoles1rPreCondition();
70          Object result = this.shieldedElements(handleGetRoles());
71          try
72          {
73              getRoles1r = (java.util.Collection)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          handleGetRoles1rPostCondition();
81          return getRoles1r;
82      }
83  
84      protected abstract java.util.Collection handleGetRoles();
85  
86      private void handleGetService2rPreCondition()
87      {
88      }
89  
90      private void handleGetService2rPostCondition()
91      {
92      }
93  
94      public final org.andromda.metafacades.uml.Service getService()
95      {
96          org.andromda.metafacades.uml.Service getService2r = null;
97          handleGetService2rPreCondition();
98          Object result = this.shieldedElement(handleGetService());
99          try
100         {
101             getService2r = (org.andromda.metafacades.uml.Service)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         handleGetService2rPostCondition();
109         return getService2r;
110     }
111 
112     protected abstract java.lang.Object handleGetService();
113 
114     /***
115      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
116      */
117     public void validateInvariants(java.util.Collection validationMessages)
118     {
119         super.validateInvariants(validationMessages);
120     }
121     
122     /***
123      * The property that stores the name of the metafacade.
124      */
125     private static final String NAME_PROPERTY = "name";
126     
127     /***
128      * @see java.lang.Object#toString()
129      */
130     public String toString()
131     {
132         final StringBuffer toString = new StringBuffer(this.getClass().getName());
133         toString.append("[");
134         try
135         {
136             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
137         }
138         catch (final Throwable throwable)
139         {
140             // - just ignore when the metafacade doesn't have a name property
141         }
142         toString.append("]");
143         return toString.toString();
144     }
145 }