View Javadoc

1   package net.sf.tomp.xtcl.command;
2   
3   import net.sf.tomp.xtcl.Context;
4   
5   /***
6    * Dumps this Context and also its ancestors.
7    * 
8    * @author tomp
9    */
10  public class DumpContexts extends AbstractCommand {
11  
12  	/*** deep? */
13      protected boolean deep = false;
14  
15      /***
16       * set deep
17       * 
18       * @param v deep?
19       */
20      public void setDeep(boolean v) {
21          deep = v;
22      }
23  
24      /***
25       * Dumps this Context and also its ancestors.
26       * 
27       * @param context what to dump
28       * @return 0 if OK
29       * @throws Exception 
30       */
31      public int execute(Context context) throws Exception {
32  
33          context.dumpAll(deep);
34  
35          return done(context, 0);
36      }
37  
38      /***
39       * String representation
40       * 
41       * @return "DUMP ALL CONTEXTS " + (deep ? "WITH VARIABLE CONTENT" : "");
42       */
43      public String toString() {
44          return "DUMP ALL CONTEXTS " + (deep ? "WITH VARIABLE CONTENT" : "");
45      }
46  }
47  
48  /*
49   * The contents of this file are subject to the Mozilla Public License Version
50   * 1.1 (the "License"); you may not use this file except in compliance with the
51   * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
52   * Software distributed under the License is distributed on an "AS IS" basis,
53   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
54   * the specific language governing rights and limitations under the License. The
55   * Original Code is: all this file. The Initial Developer of the Original Code
56   * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s):
57   */