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