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.FrontEndExceptionHandler
8    *
9    * @see org.andromda.metafacades.uml.FrontEndExceptionHandler
10   */
11  public abstract class FrontEndExceptionHandlerLogic
12      extends org.andromda.metafacades.uml14.FrontEndForwardLogicImpl
13      implements org.andromda.metafacades.uml.FrontEndExceptionHandler
14  {
15  
16      protected Object metaObject;
17  
18      public FrontEndExceptionHandlerLogic(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.FrontEndExceptionHandler";
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.FrontEndExceptionHandler
50       */
51      public boolean isFrontEndExceptionHandlerMetaType()
52      {
53          return true;
54      }
55      
56      // --------------- attributes ---------------------
57  
58     /***
59      * @see org.andromda.metafacades.uml.FrontEndExceptionHandler#isFrontEndException()
60      */
61      protected abstract boolean handleIsFrontEndException();
62  
63      private void handleIsFrontEndException1aPreCondition()
64      {
65      }
66  
67      private void handleIsFrontEndException1aPostCondition()
68      {
69      }
70  
71      private boolean __frontEndException1a;
72      private boolean __frontEndException1aSet = false;
73  
74      public final boolean isFrontEndException()
75      {
76          boolean frontEndException1a = this.__frontEndException1a;
77          if (!this.__frontEndException1aSet)
78          {
79              handleIsFrontEndException1aPreCondition();
80              frontEndException1a = handleIsFrontEndException();
81              handleIsFrontEndException1aPostCondition();
82              this.__frontEndException1a = frontEndException1a;
83              if (isMetafacadePropertyCachingEnabled())
84              {
85                  this.__frontEndException1aSet = true;
86              }
87          }
88          return frontEndException1a;
89      }
90  
91      // ------------- associations ------------------
92  
93      /***
94       * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
95       */
96      public void validateInvariants(java.util.Collection validationMessages)
97      {
98          super.validateInvariants(validationMessages);
99      }
100     
101     /***
102      * The property that stores the name of the metafacade.
103      */
104     private static final String NAME_PROPERTY = "name";
105     
106     /***
107      * @see java.lang.Object#toString()
108      */
109     public String toString()
110     {
111         final StringBuffer toString = new StringBuffer(this.getClass().getName());
112         toString.append("[");
113         try
114         {
115             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
116         }
117         catch (final Throwable throwable)
118         {
119             // - just ignore when the metafacade doesn't have a name property
120         }
121         toString.append("]");
122         return toString.toString();
123     }
124 }