org.apache.commons.chain.generic
Class CopyCommand

java.lang.Object
  extended byorg.apache.commons.chain.generic.CopyCommand
All Implemented Interfaces:
Command

public class CopyCommand
extends Object
implements Command

Copy a specified literal value, or a context attribute stored under the fromKey (if any), to the toKey.

Version:
$Revision: 1.7 $ $Date: 2004/02/25 00:01:07 $
Author:
Craig R. McClanahan

Constructor Summary
CopyCommand()
           
 
Method Summary
 boolean execute(Context context)
          Copy a specified literal value, or a context attribute stored under the fromKey (if any), to the toKey.
 String getFromKey()
          Return the context attribute key for the source attribute.
 String getToKey()
          Return the context attribute key for the destination attribute.
 String getValue()
          Return the literal value to be copied.
 void setFromKey(String fromKey)
          Set the context attribute key for the source attribute.
 void setToKey(String toKey)
          Set the context attribute key for the destination attribute.
 void setValue(String value)
          Set the literal value to be copied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyCommand

public CopyCommand()
Method Detail

getFromKey

public String getFromKey()

Return the context attribute key for the source attribute.


setFromKey

public void setFromKey(String fromKey)

Set the context attribute key for the source attribute.

Parameters:
fromKey - The new key

getToKey

public String getToKey()

Return the context attribute key for the destination attribute.


setToKey

public void setToKey(String toKey)

Set the context attribute key for the destination attribute.

Parameters:
toKey - The new key

getValue

public String getValue()

Return the literal value to be copied.


setValue

public void setValue(String value)

Set the literal value to be copied.

Parameters:
value - The new value

execute

public boolean execute(Context context)
                throws Exception

Copy a specified literal value, or a context attribute stored under the fromKey (if any), to the toKey.

Specified by:
execute in interface Command
Parameters:
context - Context in which we are operating
Returns:
false so that processing will continue
Throws:
Exception - general purpose exception return to indicate abnormal termination


Copyright © 2003-2005 The Apache Software Foundation. All Rights Reserved.