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.EntityQueryOperation
8    *
9    * @see org.andromda.metafacades.uml.EntityQueryOperation
10   */
11  public abstract class EntityQueryOperationLogic
12      extends org.andromda.metafacades.uml14.OperationFacadeLogicImpl
13      implements org.andromda.metafacades.uml.EntityQueryOperation
14  {
15  
16      protected Object metaObject;
17  
18      public EntityQueryOperationLogic(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.EntityQueryOperation";
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.EntityQueryOperation
50       */
51      public boolean isEntityQueryOperationMetaType()
52      {
53          return true;
54      }
55      
56      // ---------------- business methods ----------------------
57  
58      protected abstract java.lang.String handleGetQuery(java.lang.String translation);
59  
60      private void handleGetQuery1oPreCondition()
61      {
62      }
63  
64      private void handleGetQuery1oPostCondition()
65      {
66      }
67  
68      public java.lang.String getQuery(java.lang.String translation)
69      {
70          handleGetQuery1oPreCondition();
71          java.lang.String returnValue = handleGetQuery(translation);
72          handleGetQuery1oPostCondition();
73          return returnValue;
74      }
75  
76      // ------------- associations ------------------
77  
78      /***
79       * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
80       */
81      public void validateInvariants(java.util.Collection validationMessages)
82      {
83          super.validateInvariants(validationMessages);
84      }
85      
86      /***
87       * The property that stores the name of the metafacade.
88       */
89      private static final String NAME_PROPERTY = "name";
90      
91      /***
92       * @see java.lang.Object#toString()
93       */
94      public String toString()
95      {
96          final StringBuffer toString = new StringBuffer(this.getClass().getName());
97          toString.append("[");
98          try
99          {
100             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
101         }
102         catch (final Throwable throwable)
103         {
104             // - just ignore when the metafacade doesn't have a name property
105         }
106         toString.append("]");
107         return toString.toString();
108     }
109 }