View Javadoc

1   package net.sf.tomp.xtcl.command;
2   
3   import net.sf.tomp.xtcl.Context;
4   import net.sf.tomp.xtcl.filter.MyMultiFilter;
5   
6   import java.io.PrintStream;
7   
8   /***
9    * DOCUMENT ME!
10   * 
11   * @author tomp
12   */
13  public class MyMultiFilterCommand extends VarCommand {
14      MyMultiFilter af;
15  
16      /***
17       * DOCUMENT ME!
18       * 
19       * @param context DOCUMENT ME!
20       * @return DOCUMENT ME!
21       * @throws Exception DOCUMENT ME!
22       */
23      public int execute(Context context) throws Exception {
24          PrintStream out = context.getOut();
25  
26          if (out == null) {
27              return 0;
28          }
29  
30          af = new MyMultiFilter();
31          context.put(var, af);
32          out.print("OK " + this);
33  
34          return 0;
35      }
36  
37      /***
38       * DOCUMENT ME!
39       * 
40       * @return DOCUMENT ME!
41       */
42      public String toString() {
43          return "MYMULTIFILTER " + var + " (" + listFilters() + ")";
44      }
45  
46      /***
47       * DOCUMENT ME!
48       * 
49       * @return DOCUMENT ME!
50       */
51      protected String listFilters() {
52          return af.getFilters().toString();
53      }
54  }
55  
56  /*
57   * The contents of this file are subject to the Mozilla Public License Version
58   * 1.1 (the "License"); you may not use this file except in compliance with the
59   * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
60   * Software distributed under the License is distributed on an "AS IS" basis,
61   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
62   * the specific language governing rights and limitations under the License. The
63   * Original Code is: all this file. The Initial Developer of the Original Code
64   * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s):
65   */