1 package net.sf.tomp.xtcl.command;
2
3 import net.sf.tomp.xtcl.Context;
4
5 /***
6 * DOCUMENT ME!
7 *
8 * @author tomp
9 */
10 public class Template extends AbstractCommand {
11 /*** Template name */
12 private String name;
13
14 /*** Template command */
15 private String body;
16
17 /***
18 * @return Returns the body.
19 */
20 public String getBody() {
21 return body;
22 }
23
24 /***
25 * @return Returns the name.
26 */
27 public String getName() {
28 return name;
29 }
30
31 /***
32 * DOCUMENT ME!
33 *
34 * @param context DOCUMENT ME!
35 * @return DOCUMENT ME!
36 * @throws Exception DOCUMENT ME!
37 */
38 public int execute(Context context) throws Exception {
39 return done(context, 0);
40 }
41
42 /***
43 * DOCUMENT ME!
44 *
45 * @param p DOCUMENT ME!
46 */
47 public void setName(String p) {
48 name = p;
49 }
50
51 /***
52 * Set the command (sequence) found in this template body
53 *
54 * @param c the command from the body
55 */
56 public void setBody(String b) {
57 body = b;
58 }
59
60 /***
61 * DOCUMENT ME!
62 *
63 * @return DOCUMENT ME!
64 */
65 public String toString() {
66 return "TEMPLATE " + name + " {" + body + "}";
67 }
68 }
69
70
71
72
73
74
75
76
77
78
79