antlraux package
v0.2.1

antlraux.clparse
Class Command

java.lang.Object
  |
  +--antlraux.clparse.Command

public class Command
extends java.lang.Object

A Command is the union of a CommandSpec and a list of parameters. It encapsulates one command in the command line. Instances of Command are created by a CommandLineParser during the parsing of the command line

Author:
Enrique José García Cota

Field Summary
protected  CommandSpec spec
           
 
Constructor Summary
Command(CommandSpec spec, java.lang.Object[] params)
          Only constructor of the class
 
Method Summary
 java.lang.Object execute()
          This method "launches" a command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spec

protected CommandSpec spec
Constructor Detail

Command

public Command(CommandSpec spec,
               java.lang.Object[] params)
        throws CommandLineParserException
Only constructor of the class

Method Detail

execute

public java.lang.Object execute()
                         throws CommandLineParserException
This method "launches" a command. In order to do this, it obtains the Method and executer of the CommandSpec. Then it calls Method.invoke(Object, Object[]) using its parameters list.

Returns:
the Object returned by Method.invoke(Object, Object[])
Throws:
ExecutedMethodException - if Method.invoke(Object, Object[]) throws InvocationTargetException
CommandLineException - if any other error happens.
CommandLineParserException

antlraux package
v0.2.1

Created by Enrique José García Cota