nl.toolforge.karma.core.cmd
Class CommandDescriptor

java.lang.Object
  extended bynl.toolforge.karma.core.cmd.CommandDescriptor

public final class CommandDescriptor
extends java.lang.Object

A CommandDescriptor is the object representation of a command as it is specified in a command.xml file.

Version:
$Id: CommandDescriptor.java,v 1.21 2004/11/10 23:53:07 asmedes Exp $
Author:
D.A. Smedes

Constructor Summary
CommandDescriptor(java.lang.String name, java.lang.String aliasString)
           
 
Method Summary
 void addOptions(org.apache.commons.cli.Options options)
           
 boolean equals(java.lang.Object o)
          Commands are equal when their names are equal or any alias equals an alias from o or the other way around.
 java.lang.String getAlias()
           
 java.util.Set getAliasList()
          The aliasses of a command are all Strings by which the command can be referenced (including its name).
 java.lang.String getClassName()
           
 java.lang.String getDescription()
           
 java.lang.String getHelp()
           
 java.lang.String getName()
          Returns the name of the command represented by this CommandDescriptor.
 org.apache.commons.cli.Options getOptions()
           
 void setClassName(java.lang.String className)
           
 void setDescription(java.lang.String description)
           
 void setHelp(java.lang.String helpText)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandDescriptor

public CommandDescriptor(java.lang.String name,
                         java.lang.String aliasString)
Method Detail

getName

public java.lang.String getName()
Returns the name of the command represented by this CommandDescriptor.

Returns:
The name of the command represented by this CommandDescriptor

getAliasList

public java.util.Set getAliasList()
The aliasses of a command are all Strings by which the command can be referenced (including its name).

Returns:

getAlias

public java.lang.String getAlias()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

addOptions

public void addOptions(org.apache.commons.cli.Options options)
Parameters:
options - The name of the command (the lt;options>-child-element attribute of the <command>-element).

getOptions

public org.apache.commons.cli.Options getOptions()

getClassName

public java.lang.String getClassName()

setClassName

public void setClassName(java.lang.String className)

setHelp

public void setHelp(java.lang.String helpText)

getHelp

public java.lang.String getHelp()

equals

public boolean equals(java.lang.Object o)
Commands are equal when their names are equal or any alias equals an alias from o or the other way around.

Parameters:
o - The object instance that should be compared with this.
Returns:
true if this command descriptor is equal to o or null when o is not a CommandDescriptor instance or when it is not the same object.

toString

public java.lang.String toString()


Copyright © 2002-2004 Toolforge. All Rights Reserved.