com.iplanet.jato.command
Class CommandDescriptor

java.lang.Object
  |
  +--com.iplanet.jato.command.CommandDescriptor

public class CommandDescriptor
extends java.lang.Object

Provides the minimum set of information needed to support the automatic execution of a specific Command.

Since:
JATO/1.2
Version:
JATO/1.2.2 $Id: CommandDescriptor.java,v 1.6 2002/03/16 03:26:29 todd Exp $

Constructor Summary
CommandDescriptor()
          Default Constructor
CommandDescriptor(java.lang.Class commandClass, java.lang.String operationName)
          Creates a CommandDescriptor object
CommandDescriptor(java.lang.Class commandClass, java.lang.String operationName, java.util.Map parameters)
          Creates a CommandDescriptor object
CommandDescriptor(Command command, java.lang.String operationName)
          Creates a CommandDescriptor object
CommandDescriptor(Command command, java.lang.String operationName, java.util.Map parameters)
          Creates a CommandDescriptor object
 
Method Summary
 Command getCommand()
          Returns the Command instance that should be executed.
 java.lang.Class getCommandClass()
          Returns the class of the Command that should be executed
protected  java.lang.Class getDefaultCommandClass()
          Returns the default command class.
 java.lang.String getOperationName()
          Returns the command operation that should be used during execution of the Command
 java.lang.Object getParameter(java.lang.Object key)
          Convenience method for getting the value of a command parameter
 java.util.Map getParameters()
          Return the map of command parameters
 void setCommand(Command value)
          Sets the Command instance that should be executed.
 void setCommandClass(java.lang.Class value)
          Sets the class of the Command that should be executed
 void setOperationName(java.lang.String value)
          Sets the command operation that should be used during execution of the Command
 void setParameter(java.lang.Object key, java.lang.Object value)
          Convenience method for setting the value of a command parameter
 void setParameters(java.util.Map value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandDescriptor

public CommandDescriptor()
Default Constructor

CommandDescriptor

public CommandDescriptor(java.lang.Class commandClass,
                         java.lang.String operationName)
Creates a CommandDescriptor object
Parameters:
commandClass - The class of the Command to be executed, or null if the default behavior should be executed
operationName - The name of the command operation that should be used during execution of the Command

CommandDescriptor

public CommandDescriptor(Command command,
                         java.lang.String operationName)
Creates a CommandDescriptor object
Parameters:
command - The Command instance that should be executed.
operationName - The name of the command operation that should be used during execution of the Command

CommandDescriptor

public CommandDescriptor(java.lang.Class commandClass,
                         java.lang.String operationName,
                         java.util.Map parameters)
Creates a CommandDescriptor object
Parameters:
commandClass - The class of the Command to be executed, or null if the default behavior should be executed
operationName - The name of the command operation that should be used during execution of the Command
parameters - The command paramaters may be an arbitrarily complex collection of objects which are meaningful to the Command object at the time of command execution.

CommandDescriptor

public CommandDescriptor(Command command,
                         java.lang.String operationName,
                         java.util.Map parameters)
Creates a CommandDescriptor object
Parameters:
command - The Command instance that should be executed.
operationName - The name of the command operation that should be used during execution of the Command
parameters - The command paramaters may be an arbitrarily complex collection of objects which are meaningful to the Command object at the time of command execution.
Method Detail

getCommand

public Command getCommand()
Returns the Command instance that should be executed. This method may optionally return null if the caller should create the command from the command class specified by the getCommandClass() method. The main reason this method exists is to allow specification of command objects that require significant initialization.
Returns:
The Command instance to be executed, or null if the caller should create the command from the command class specified by the getCommandClass() method.
Since:
JATO/1.2

setCommand

public void setCommand(Command value)
Sets the Command instance that should be executed. This method may optionally return null if the caller should create the command from the command class specified by the getCommandClass() method. The main reason this method exists is to allow specification of command objects that require significant initialization.
Parameters:
value - The Command instance to be executed, or null if the caller should create the command from the command class specified by the getCommandClass() method.
Since:
JATO/1.2

getCommandClass

public java.lang.Class getCommandClass()
Returns the class of the Command that should be executed
Returns:
The class of the Command to be executed, or null if the default behavior should be executed
Since:
JATO/1.2

setCommandClass

public void setCommandClass(java.lang.Class value)
Sets the class of the Command that should be executed
Returns:
The class of the Command to be executed, or null if the default behavior should be executed
Since:
JATO/1.2

getDefaultCommandClass

protected java.lang.Class getDefaultCommandClass()
Returns the default command class. This method is executed when the getCommandClass() method is called but no command class has been specified. This returned class is null by default; developers should override this method in subclasses to provide a default command class.
Since:
JATO/1.2

getOperationName

public java.lang.String getOperationName()
Returns the command operation that should be used during execution of the Command
Returns:
A command operation meaningful to the target Command. This value may be null if the target Command allows that value. The default value of the operation name is the constant Command.DEFAULT_OPERATION_NAME .
Since:
JATO/1.2

setOperationName

public void setOperationName(java.lang.String value)
Sets the command operation that should be used during execution of the Command
Parameters:
value - A command operation meaningful to the target Command. This value may be null if the target Command allows that value. The default value of the operation name is the constant Command.DEFAULT_OPERATION_NAME .
Since:
JATO/1.2

getParameters

public java.util.Map getParameters()
Return the map of command parameters

setParameters

public void setParameters(java.util.Map value)

getParameter

public java.lang.Object getParameter(java.lang.Object key)
Convenience method for getting the value of a command parameter

setParameter

public void setParameter(java.lang.Object key,
                         java.lang.Object value)
Convenience method for setting the value of a command parameter