org.edg.data.util
Class CommandFactory

java.lang.Object
  |
  +--org.edg.data.util.CommandFactory

public final class CommandFactory
extends java.lang.Object

This interface provides a way to create one of a set of pre-configured commands by specifying its name or shortcut and its arguments.

Version:
$ Id:$
Author:
James Casey

Constructor Summary
CommandFactory(java.lang.String configResource)
           
 
Method Summary
 CommandBase createCommand(java.lang.String commandName, java.lang.String[] commandArgs)
          Create a new command object.
 CommandConfiguration getConfiguration()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandFactory

public CommandFactory(java.lang.String configResource)
               throws InvalidConfigurationException,
                      java.io.FileNotFoundException
Method Detail

createCommand

public CommandBase createCommand(java.lang.String commandName,
                                 java.lang.String[] commandArgs)
                          throws InvalidConfigurationException,
                                 CommandLineException
Create a new command object. We assume the command name is an actual command name, not a shortcut, and that the argument list is not null

Parameters:
commandName - the command name
commandArgs - it's argument list
Returns:
the command object
Throws:
InvalidConfigurationException - if a problme exists with the contents of the configuration file
CommandLineException - if the command line options are not specified properly

getConfiguration

public CommandConfiguration getConfiguration()