Forge - Parent 1.2.3-SNAPSHOT

org.jboss.forge.shell.command
Interface CommandMetadata


public interface CommandMetadata

Defines a command.

Author:
Lincoln Baxter, III

Method Summary
 String getHelp()
          Get the help text for this command.
 Method getMethod()
          Get the Method that implements this command.
 String getName()
          Get the name of this command.
 OptionMetadata getNamedOption(String name)
          Get the option defined by the given name.
 int getNumOrderedOptions()
          Return the number of ordered (unnamed) options defined by this command.
 OptionMetadata getOptionByAbsoluteIndex(int index)
          Return the option at the given index in the plugin method signature, not the index of the option on the command line.
 List<OptionMetadata> getOptions()
          Return a list of all options defined by this command.
 OptionMetadata getOrderedOptionByIndex(int index)
          Return the option at the given index as required on the command line, not the index of the option in the implementing method signature.
 PluginMetadata getParent()
          Return the PluginMetadata containing this command.
 Set<Class<? extends Resource>> getResourceScopes()
          Return the set of Resource types for which this command is in scope, or available.
 boolean hasOption(String name)
          Return true if this command has an OptionMetadata with the given name.
 boolean hasOptions()
          Return true if this command has any options.
 boolean hasOrderedOptions()
          Return true if this command accepts ordered options.
 boolean hasShortOption(String name)
          Return true if this command accepts options that declare a short name.
 boolean isDefault()
          Return true if this command is the default command for its declaring PluginMetadata
 boolean isSetup()
          Return true if this command is the "setup" command.
 boolean usableWithResource(Class<? extends Resource> class1)
          Return true if this command is usable with the given resource scope.
 

Method Detail

getHelp

String getHelp()
Get the help text for this command.


getMethod

Method getMethod()
Get the Method that implements this command.


getName

String getName()
Get the name of this command.


getNamedOption

OptionMetadata getNamedOption(String name)
                              throws IllegalArgumentException
Get the option defined by the given name.

Throws:
IllegalArgumentException - if no such option exists.

getNumOrderedOptions

int getNumOrderedOptions()
Return the number of ordered (unnamed) options defined by this command.


getOptionByAbsoluteIndex

OptionMetadata getOptionByAbsoluteIndex(int index)
Return the option at the given index in the plugin method signature, not the index of the option on the command line.


getOptions

List<OptionMetadata> getOptions()
Return a list of all options defined by this command.


getOrderedOptionByIndex

OptionMetadata getOrderedOptionByIndex(int index)
                                       throws IllegalArgumentException
Return the option at the given index as required on the command line, not the index of the option in the implementing method signature.

Throws:
IllegalArgumentException

getParent

PluginMetadata getParent()
Return the PluginMetadata containing this command.


getResourceScopes

Set<Class<? extends Resource>> getResourceScopes()
Return the set of Resource types for which this command is in scope, or available.


hasOption

boolean hasOption(String name)
Return true if this command has an OptionMetadata with the given name.


hasOptions

boolean hasOptions()
Return true if this command has any options.


hasOrderedOptions

boolean hasOrderedOptions()
Return true if this command accepts ordered options.


hasShortOption

boolean hasShortOption(String name)
Return true if this command accepts options that declare a short name.


isDefault

boolean isDefault()
Return true if this command is the default command for its declaring PluginMetadata


usableWithResource

boolean usableWithResource(Class<? extends Resource> class1)
Return true if this command is usable with the given resource scope.


isSetup

boolean isSetup()
Return true if this command is the "setup" command.


Forge - Parent 1.2.3-SNAPSHOT

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.