1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.chain.generic;
17
18
19 import org.apache.commons.chain.Command;
20 import org.apache.commons.chain.Context;
21
22
23 /***
24 * <p>Remove any context attribute stored under the <code>fromKey</code>.</p>
25 *
26 * @author Craig R. McClanahan
27 * @version $Revision: 1.6 $ $Date: 2004/02/25 00:01:07 $
28 */
29
30 public class RemoveCommand implements Command {
31
32
33
34
35
36 private String fromKey = null;
37
38
39 /***
40 * <p>Return the context attribute key for the attribute.</p>
41 */
42 public String getFromKey() {
43
44 return (this.fromKey);
45
46 }
47
48
49 /***
50 * <p>Set the context attribute key for the attribute.</p>
51 *
52 * @param fromKey The new key
53 */
54 public void setFromKey(String fromKey) {
55
56 this.fromKey = fromKey;
57
58 }
59
60
61
62
63
64 /***
65 * <p>Copy the specified source attribute to the specified destination
66 * attribute.</p>
67 *
68 * @param context {@link Context} in which we are operating
69 *
70 * @return <code>false</code> so that processing will continue
71 */
72 public boolean execute(Context context) throws Exception {
73
74 context.remove(getFromKey());
75 return (false);
76
77 }
78
79
80 }