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: 410386 $ $Date: 2006-05-30 22:48:31 +0100 (Tue, 30 May 2006) $
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 * @return The context attribute key.
42 */
43 public String getFromKey() {
44
45 return (this.fromKey);
46
47 }
48
49
50 /***
51 * <p>Set the context attribute key for the attribute.</p>
52 *
53 * @param fromKey The new key
54 */
55 public void setFromKey(String fromKey) {
56
57 this.fromKey = fromKey;
58
59 }
60
61
62
63
64
65 /***
66 * <p>Copy the specified source attribute to the specified destination
67 * attribute.</p>
68 *
69 * @param context {@link Context} in which we are operating
70 *
71 * @return <code>false</code> so that processing will continue
72 * @throws Exception if and error occurs.
73 */
74 public boolean execute(Context context) throws Exception {
75
76 context.remove(getFromKey());
77 return (false);
78
79 }
80
81
82 }