View Javadoc

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