View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4   //
5   package org.andromda.metafacades.uml14;
6   
7   import java.util.Collection;
8   import org.andromda.core.metafacade.MetafacadeBase;
9   import org.andromda.core.metafacade.ModelValidationMessage;
10  import org.andromda.metafacades.uml.EntityAttribute;
11  import org.andromda.metafacades.uml.ManageableEntityAssociationEnd;
12  import org.apache.log4j.Logger;
13  
14  /**
15   * TODO: Model Documentation for ManageableEntityAssociationEnd
16   * MetafacadeLogic for ManageableEntityAssociationEnd
17   *
18   * @see ManageableEntityAssociationEnd
19   */
20  public abstract class ManageableEntityAssociationEndLogic
21      extends EntityAssociationEndLogicImpl
22      implements ManageableEntityAssociationEnd
23  {
24      /**
25       * The underlying UML object
26       * @see Object
27       */
28      protected Object metaObject;
29  
30      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
31       * @param metaObjectIn
32       * @param context
33       */
34      protected ManageableEntityAssociationEndLogic(Object metaObjectIn, String context)
35      {
36          super(metaObjectIn, getContext(context));
37          this.metaObject = metaObjectIn;
38      }
39  
40      /**
41       * The logger instance.
42       */
43      private static final Logger logger = Logger.getLogger(ManageableEntityAssociationEndLogic.class);
44  
45      /**
46       * Gets the context for this metafacade logic instance.
47       * @param context String. Set to ManageableEntityAssociationEnd if null
48       * @return context String
49       */
50      private static String getContext(String context)
51      {
52          if (context == null)
53          {
54              context = "org.andromda.metafacades.uml.ManageableEntityAssociationEnd";
55          }
56          return context;
57      }
58  
59      /** Reset context only for non-root metafacades
60       * @param context
61       */
62      @Override
63      public void resetMetafacadeContext(String context)
64      {
65          if (!this.contextRoot) // reset context only for non-root metafacades
66          {
67              context = getContext(context);  // to have same value as in original constructor call
68              setMetafacadeContext (context);
69          }
70      }
71  
72      /**
73       * @return boolean true always
74       * @see ManageableEntityAssociationEnd
75       */
76      public boolean isManageableEntityAssociationEndMetaType()
77      {
78          return true;
79      }
80  
81      // --------------- attributes ---------------------
82  
83     /**
84      * @see ManageableEntityAssociationEnd#isDisplay()
85      * @return boolean
86      */
87      protected abstract boolean handleIsDisplay();
88  
89      private boolean __display1a;
90      private boolean __display1aSet = false;
91  
92      /**
93       * Whether or not this association end should be displayed.
94       * @return (boolean)handleIsDisplay()
95       */
96      public final boolean isDisplay()
97      {
98          boolean display1a = this.__display1a;
99          if (!this.__display1aSet)
100         {
101             // display has no pre constraints
102             display1a = handleIsDisplay();
103             // display has no post constraints
104             this.__display1a = display1a;
105             if (isMetafacadePropertyCachingEnabled())
106             {
107                 this.__display1aSet = true;
108             }
109         }
110         return display1a;
111     }
112 
113     // ------------- associations ------------------
114 
115     private EntityAttribute __getManageableIdentifier1r;
116     private boolean __getManageableIdentifier1rSet = false;
117 
118     /**
119      * TODO: Model Documentation for ManageableEntityAssociationEnd
120      * @return (EntityAttribute)handleGetManageableIdentifier()
121      */
122     public final EntityAttribute getManageableIdentifier()
123     {
124         EntityAttribute getManageableIdentifier1r = this.__getManageableIdentifier1r;
125         if (!this.__getManageableIdentifier1rSet)
126         {
127             // manageableEntityAssociationEnd has no pre constraints
128             Object result = handleGetManageableIdentifier();
129             MetafacadeBase shieldedResult = this.shieldedElement(result);
130             try
131             {
132                 getManageableIdentifier1r = (EntityAttribute)shieldedResult;
133             }
134             catch (ClassCastException ex)
135             {
136                 // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
137                 ManageableEntityAssociationEndLogic.logger.warn("incorrect metafacade cast for ManageableEntityAssociationEndLogic.getManageableIdentifier EntityAttribute " + result + ": " + shieldedResult);
138             }
139             // manageableEntityAssociationEnd has no post constraints
140             this.__getManageableIdentifier1r = getManageableIdentifier1r;
141             if (isMetafacadePropertyCachingEnabled())
142             {
143                 this.__getManageableIdentifier1rSet = true;
144             }
145         }
146         return getManageableIdentifier1r;
147     }
148 
149     /**
150      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
151      * @return Object
152      */
153     protected abstract Object handleGetManageableIdentifier();
154 
155     /**
156      * @param validationMessages Collection<ModelValidationMessage>
157      * @see EntityAssociationEndLogicImpl#validateInvariants(Collection validationMessages)
158      */
159     @Override
160     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
161     {
162         super.validateInvariants(validationMessages);
163     }
164 }