org.jomc.cli
Interface Command

Package class diagram package Command
All Known Implementing Classes:
AbstractJomcCommand, CommitJavaClassesCommand, GenerateJavaBundlesCommand, ManageJavaSourcesCommand, MergeModulesCommand, ValidateJavaClassesCommand, ValidateModulesCommand

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public interface Command

Command.

This specification declares a multiplicity of Many. An application assembler may provide multiple implementations of this specification (including none). Use of class ObjectManager is supported for getting these implementations or for selecting a single implementation.

 Command[] objects = (Command[]) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Command.class );
 Command object = ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Command.class, "implementation name" );
 

This specification does not apply to any scope. A new object is returned whenever requested.

Version:
$Id: Command.java 1102 2009-12-07 03:01:58Z schulte2005 $
Author:
Christian Schulte 1.0

Nested Class Summary
static interface Command.Listener
          Listener interface.
 
Field Summary
static int STATUS_FAILURE
          Status code when the command failed.
static int STATUS_SUCCESS
          Status code when the command completed successfully.
 
Method Summary
 int execute(org.apache.commons.cli.CommandLine commandLine)
          Executes the command.
 String getAbbreviatedName()
          Gets the abbreviated name of the command.
 List<Command.Listener> getListeners()
          Gets the list of registered listeners.
 Level getLogLevel()
          Gets the log level of the instance.
 String getLongDescription(Locale locale)
          Gets the long description of the command.
 String getName()
          Gets the name of the command.
 org.apache.commons.cli.Options getOptions()
          Gets the options of the command.
 String getShortDescription(Locale locale)
          Gets the short description of the command.
 void setLogLevel(Level value)
          Sets the log level of the instance.
 

Field Detail

STATUS_SUCCESS

static final int STATUS_SUCCESS
Status code when the command completed successfully.

See Also:
Constant Field Values

STATUS_FAILURE

static final int STATUS_FAILURE
Status code when the command failed.

See Also:
Constant Field Values
Method Detail

getListeners

List<Command.Listener> getListeners()
Gets the list of registered listeners.

Returns:
The list of registered listeners.

getLogLevel

Level getLogLevel()
Gets the log level of the instance.

Returns:
The log level of the instance.
See Also:
setLogLevel(java.util.logging.Level)

setLogLevel

void setLogLevel(Level value)
Sets the log level of the instance.

Parameters:
value - The new log level of the instance or null.
See Also:
getLogLevel()

getName

String getName()
Gets the name of the command.

Returns:
The name of the command.

getAbbreviatedName

String getAbbreviatedName()
Gets the abbreviated name of the command.

Returns:
The abbreviated name of the command.

getShortDescription

String getShortDescription(Locale locale)
                           throws NullPointerException
Gets the short description of the command.

Parameters:
locale - The locale of the short description to return.
Returns:
The short description of the command.
Throws:
NullPointerException - if locale is null.

getLongDescription

String getLongDescription(Locale locale)
                          throws NullPointerException
Gets the long description of the command.

Parameters:
locale - The locale of the long description to return.
Returns:
The long description of the command.
Throws:
NullPointerException - if locale is null.

getOptions

org.apache.commons.cli.Options getOptions()
Gets the options of the command.

Returns:
The options of the command.

execute

int execute(org.apache.commons.cli.CommandLine commandLine)
            throws NullPointerException
Executes the command.

Parameters:
commandLine - Command line to execute.
Returns:
The status code of the command.
Throws:
NullPointerException - if commandLine is null.
See Also:
STATUS_SUCCESS, STATUS_FAILURE


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.