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.ManageableEntityAssociationEnd
8    *
9    * @see org.andromda.metafacades.uml.ManageableEntityAssociationEnd
10   */
11  public abstract class ManageableEntityAssociationEndLogic
12      extends org.andromda.metafacades.uml14.EntityAssociationEndLogicImpl
13      implements org.andromda.metafacades.uml.ManageableEntityAssociationEnd
14  {
15  
16      protected Object metaObject;
17  
18      public ManageableEntityAssociationEndLogic(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.ManageableEntityAssociationEnd";
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.ManageableEntityAssociationEnd
50       */
51      public boolean isManageableEntityAssociationEndMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.ManageableEntityAssociationEnd#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      // ------------- associations ------------------
92  
93      private void handleGetManageableIdentifier2rPreCondition()
94      {
95      }
96  
97      private void handleGetManageableIdentifier2rPostCondition()
98      {
99      }
100 
101     private org.andromda.metafacades.uml.EntityAttribute __getManageableIdentifier2r;
102     private boolean __getManageableIdentifier2rSet = false;
103 
104     public final org.andromda.metafacades.uml.EntityAttribute getManageableIdentifier()
105     {
106         org.andromda.metafacades.uml.EntityAttribute getManageableIdentifier2r = this.__getManageableIdentifier2r;
107         if (!this.__getManageableIdentifier2rSet)
108         {
109             handleGetManageableIdentifier2rPreCondition();
110             Object result = this.shieldedElement(handleGetManageableIdentifier());
111             try
112             {
113                 getManageableIdentifier2r = (org.andromda.metafacades.uml.EntityAttribute)result;
114             }
115             catch (ClassCastException ex)
116             {
117                 // ignore since the metafacade shouldn't
118                 // be set if its not of the correct type
119             }
120             handleGetManageableIdentifier2rPostCondition();
121             this.__getManageableIdentifier2r = getManageableIdentifier2r;
122             if (isMetafacadePropertyCachingEnabled())
123             {
124                 this.__getManageableIdentifier2rSet = true;
125             }
126         }
127         return getManageableIdentifier2r;
128     }
129 
130     protected abstract java.lang.Object handleGetManageableIdentifier();
131 
132     /***
133      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
134      */
135     public void validateInvariants(java.util.Collection validationMessages)
136     {
137         super.validateInvariants(validationMessages);
138     }
139     
140     /***
141      * The property that stores the name of the metafacade.
142      */
143     private static final String NAME_PROPERTY = "name";
144     
145     /***
146      * @see java.lang.Object#toString()
147      */
148     public String toString()
149     {
150         final StringBuffer toString = new StringBuffer(this.getClass().getName());
151         toString.append("[");
152         try
153         {
154             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
155         }
156         catch (final Throwable throwable)
157         {
158             // - just ignore when the metafacade doesn't have a name property
159         }
160         toString.append("]");
161         return toString.toString();
162     }
163 }