Forge - Parent 1.0.7-SNAPSHOT

org.jboss.forge.shell.command
Interface PluginMetadata


public interface PluginMetadata

Defines a plugin.

Author:
Lincoln Baxter, III

Method Summary
 boolean constrantsSatisfied(Shell shell)
          Return true if all constraints defined on this plugin (such as RequiresProject or RequiresFacet) are satisfied by the current project (if available) and Shell.getCurrentResource() scope.
 List<CommandMetadata> getAllCommands()
          Get a list of all commands defined by this plugin, regardless of the current Shell.getCurrentResource() scope or constraints.
 CommandMetadata getCommand(String name)
          Get the command with the given name, if it exists in this plugin and is not overloaded in multiple Resource scopes.
 CommandMetadata getCommand(String name, Class<? extends Resource<?>> scope)
          Get the command with the given name and Resource scope, if it exists in this plugin.
 CommandMetadata getCommand(String name, Shell shell)
          Get the command with the given name if it exists in this plugin, and is available in the current Shell.getCurrentResource() scope.
 List<CommandMetadata> getCommands()
          Get a list of all commands defined by this plugin, if they are in scope.
 List<CommandMetadata> getCommands(Shell shell)
          For the Shell.getCurrentResource() scope, return a list of all available commands defined by this plugin.
 CommandMetadata getDefaultCommand()
          Get the default command specified by this plugin.
 String getHelp()
          Get the help text for this plugin.
 String getName()
          Get the name by which this plugin is referenced on the command line.
 Set<Class<? extends Resource<?>>> getResourceScopes()
          Get the Resource scopes for which this plugin is available.
 CommandMetadata getSetupCommand()
          Get the "setup" command for this plugin.
 String getTopic()
          Get the topic text for this plugin.
 Class<? extends Plugin> getType()
          Get the implementing Plugin class type for this PluginMetadata
 boolean hasCommand(String name, Class<? extends Resource<?>> scope)
          Return true if this plugin defines a command with the given name and Resource scope.
 boolean hasCommand(String name, Shell shell)
          Return true if this plugin defines a command with the given name in the current Shell.getCurrentResourceScope()
 boolean hasCommands()
          Return true if this plugin has any commands.
 boolean hasDefaultCommand()
          Return true if this plugin has a default command.
 boolean hasSetupCommand()
          Return true if this plugin has a "setup" command.
 boolean isCommandOverloaded(String name)
          Return true if this plugin is overloaded in multiple Resource scopes.
 boolean isSetupAvailable(Shell shell)
          Return true if hasSetupCommand() returns true, and it is available in the current scope.
 boolean usableWithScope(Class<? extends Resource> scope)
          Return true if this plugin is usable in the given Resource scope
 

Method Detail

constrantsSatisfied

boolean constrantsSatisfied(Shell shell)
Return true if all constraints defined on this plugin (such as RequiresProject or RequiresFacet) are satisfied by the current project (if available) and Shell.getCurrentResource() scope.


getAllCommands

List<CommandMetadata> getAllCommands()
Get a list of all commands defined by this plugin, regardless of the current Shell.getCurrentResource() scope or constraints.


getCommand

CommandMetadata getCommand(String name)
Get the command with the given name, if it exists in this plugin and is not overloaded in multiple Resource scopes. If it does not exist, return null.


getCommand

CommandMetadata getCommand(String name,
                           Class<? extends Resource<?>> scope)
Get the command with the given name and Resource scope, if it exists in this plugin. If it does not exist, return null.


getCommand

CommandMetadata getCommand(String name,
                           Shell shell)
Get the command with the given name if it exists in this plugin, and is available in the current Shell.getCurrentResource() scope. If it does not exist, or is not in scope, return null.


getCommands

List<CommandMetadata> getCommands()
Get a list of all commands defined by this plugin, if they are in scope.


getCommands

List<CommandMetadata> getCommands(Shell shell)
For the Shell.getCurrentResource() scope, return a list of all available commands defined by this plugin.


getDefaultCommand

CommandMetadata getDefaultCommand()
Get the default command specified by this plugin. If none exists, return null.


getHelp

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


getName

String getName()
Get the name by which this plugin is referenced on the command line.


getResourceScopes

Set<Class<? extends Resource<?>>> getResourceScopes()
Get the Resource scopes for which this plugin is available.


getTopic

String getTopic()
Get the topic text for this plugin.


getType

Class<? extends Plugin> getType()
Get the implementing Plugin class type for this PluginMetadata


hasCommand

boolean hasCommand(String name,
                   Class<? extends Resource<?>> scope)
Return true if this plugin defines a command with the given name and Resource scope.


hasCommand

boolean hasCommand(String name,
                   Shell shell)
Return true if this plugin defines a command with the given name in the current Shell.getCurrentResourceScope()


hasCommands

boolean hasCommands()
Return true if this plugin has any commands.


hasDefaultCommand

boolean hasDefaultCommand()
Return true if this plugin has a default command. Default commands are executed with the name of the plugin, instead of the name of the command.


isCommandOverloaded

boolean isCommandOverloaded(String name)
Return true if this plugin is overloaded in multiple Resource scopes.


usableWithScope

boolean usableWithScope(Class<? extends Resource> scope)
Return true if this plugin is usable in the given Resource scope


hasSetupCommand

boolean hasSetupCommand()
Return true if this plugin has a "setup" command. Setup commands should be exposed even if constraints have not been satisfied.


getSetupCommand

CommandMetadata getSetupCommand()
Get the "setup" command for this plugin. Return false if no "setup" command exists.


isSetupAvailable

boolean isSetupAvailable(Shell shell)
Return true if hasSetupCommand() returns true, and it is available in the current scope.


Forge - Parent 1.0.7-SNAPSHOT

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.