View Javadoc

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