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.EnumerationLiteralFacade
8    *
9    * @see org.andromda.metafacades.uml.EnumerationLiteralFacade
10   */
11  public abstract class EnumerationLiteralFacadeLogic
12      extends org.andromda.metafacades.uml14.ModelElementFacadeLogicImpl
13      implements org.andromda.metafacades.uml.EnumerationLiteralFacade
14  {
15  
16      protected org.omg.uml.foundation.core.EnumerationLiteral metaObject;
17  
18      public EnumerationLiteralFacadeLogic(org.omg.uml.foundation.core.EnumerationLiteral 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.EnumerationLiteralFacade";
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.EnumerationLiteralFacade
50       */
51      public boolean isEnumerationLiteralFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.EnumerationLiteralFacade#getValue()
60      */
61      protected abstract java.lang.String handleGetValue();
62  
63      private void handleGetValue1aPreCondition()
64      {
65      }
66  
67      private void handleGetValue1aPostCondition()
68      {
69      }
70  
71      private java.lang.String __value1a;
72      private boolean __value1aSet = false;
73  
74      public final java.lang.String getValue()
75      {
76          java.lang.String value1a = this.__value1a;
77          if (!this.__value1aSet)
78          {
79              handleGetValue1aPreCondition();
80              value1a = handleGetValue();
81              handleGetValue1aPostCondition();
82              this.__value1a = value1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__value1aSet = true;
86              }
87          }
88          return value1a;
89      }
90  
91      // ---------------- business methods ----------------------
92  
93      protected abstract java.lang.String handleGetName(boolean modelName);
94  
95      private void handleGetName1oPreCondition()
96      {
97      }
98  
99      private void handleGetName1oPostCondition()
100     {
101     }
102 
103     public java.lang.String getName(boolean modelName)
104     {
105         handleGetName1oPreCondition();
106         java.lang.String returnValue = handleGetName(modelName);
107         handleGetName1oPostCondition();
108         return returnValue;
109     }
110 
111     protected abstract java.lang.String handleGetValue(boolean modelValue);
112 
113     private void handleGetValue2oPreCondition()
114     {
115     }
116 
117     private void handleGetValue2oPostCondition()
118     {
119     }
120 
121     public java.lang.String getValue(boolean modelValue)
122     {
123         handleGetValue2oPreCondition();
124         java.lang.String returnValue = handleGetValue(modelValue);
125         handleGetValue2oPostCondition();
126         return returnValue;
127     }
128 
129     /***
130      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
131      */
132     public void validateInvariants(java.util.Collection validationMessages)
133     {
134         super.validateInvariants(validationMessages);
135     }
136     
137     /***
138      * The property that stores the name of the metafacade.
139      */
140     private static final String NAME_PROPERTY = "name";
141     
142     /***
143      * @see java.lang.Object#toString()
144      */
145     public String toString()
146     {
147         final StringBuffer toString = new StringBuffer(this.getClass().getName());
148         toString.append("[");
149         try
150         {
151             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
152         }
153         catch (final Throwable throwable)
154         {
155             // - just ignore when the metafacade doesn't have a name property
156         }
157         toString.append("]");
158         return toString.toString();
159     }
160 }