View Javadoc

1   //
2   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
3   //
4   package org.andromda.cartridges.ejb.metafacades;
5   
6   /***
7    * MetafacadeLogic for org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade
8    *
9    * @see org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade
10   */
11  public abstract class EJBPrimaryKeyFacadeLogic
12      extends org.andromda.cartridges.ejb.metafacades.EJBEntityAttributeFacadeLogicImpl
13      implements org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade
14  {
15  
16      protected Object metaObject;
17  
18      public EJBPrimaryKeyFacadeLogic(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.cartridges.ejb.metafacades.EJBPrimaryKeyFacade";
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.cartridges.ejb.metafacades.EJBPrimaryKeyFacade
50       */
51      public boolean isEJBPrimaryKeyFacadeMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.cartridges.ejb.metafacades.EJBPrimaryKeyFacade#isComplex()
60      */
61      protected abstract boolean handleIsComplex();
62  
63      private void handleIsComplex1aPreCondition()
64      {
65      }
66  
67      private void handleIsComplex1aPostCondition()
68      {
69      }
70  
71      private boolean __complex1a;
72      private boolean __complex1aSet = false;
73  
74      public final boolean isComplex()
75      {
76          boolean complex1a = this.__complex1a;
77          if (!this.__complex1aSet)
78          {
79              handleIsComplex1aPreCondition();
80              complex1a = handleIsComplex();
81              handleIsComplex1aPostCondition();
82              this.__complex1a = complex1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__complex1aSet = true;
86              }
87          }
88          return complex1a;
89      }
90  
91      /***
92       * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
93       */
94      public void validateInvariants(java.util.Collection validationMessages)
95      {
96          super.validateInvariants(validationMessages);
97      }
98      
99      /***
100      * The property that stores the name of the metafacade.
101      */
102     private static final String NAME_PROPERTY = "name";
103     
104     /***
105      * @see java.lang.Object#toString()
106      */
107     public String toString()
108     {
109         final StringBuffer toString = new StringBuffer(this.getClass().getName());
110         toString.append("[");
111         try
112         {
113             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
114         }
115         catch (final Throwable throwable)
116         {
117             // - just ignore when the metafacade doesn't have a name property
118         }
119         toString.append("]");
120         return toString.toString();
121     }
122 }