org.jcommando
Class Command

java.lang.Object
  extended byorg.jcommando.Command

public class Command
extends java.lang.Object

Author:
Brett Wooldridge

Constructor Summary
Command()
          Constructs an object representing a command and it's required and optional "Options".
 
Method Summary
 void addOption(Option option)
          Add an option to the set of options supported by this command.
 java.lang.String getDescription()
           
 Grouping getGrouping()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 boolean isAllowOptionless()
          Determines whether this command will be executed even if there are no options specified.
 void setAllowOptionless(boolean optionless)
          Sets whether this command will be executed even if there are no options specified..
 void setDescription(java.lang.String desc)
           
 void setGrouping(Grouping group)
          Set the grouping object for this command.
 void setId(java.lang.String cmdId)
           
 void setName(java.lang.String cmdName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()
Constructs an object representing a command and it's required and optional "Options".

Method Detail

getId

public java.lang.String getId()
Returns:
Returns the id.

getName

public java.lang.String getName()
Returns:
Returns the name.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setId

public void setId(java.lang.String cmdId)
Parameters:
cmdId - The cmdId to set.

setName

public void setName(java.lang.String cmdName)
Parameters:
cmdName - The name to set.

setDescription

public void setDescription(java.lang.String desc)
Parameters:
desc - The description to set.

getGrouping

public Grouping getGrouping()
Returns:
Returns the grouping.

setGrouping

public void setGrouping(Grouping group)
Set the grouping object for this command.

Parameters:
group - The grouping to set.

addOption

public void addOption(Option option)
Add an option to the set of options supported by this command.

Parameters:
option - the option

isAllowOptionless

public boolean isAllowOptionless()
Determines whether this command will be executed even if there are no options specified.

Returns:
Returns true if this command allows optionless execution

setAllowOptionless

public void setAllowOptionless(boolean optionless)
Sets whether this command will be executed even if there are no options specified..

Parameters:
optionless - true if optionless execution is allowed, false otherwises