org.nuxeo.ecm.shell
Class DefaultCommandDescriptor
java.lang.Object
org.nuxeo.ecm.shell.DefaultCommandDescriptor
- All Implemented Interfaces:
- Comparable<CommandDescriptor>, CommandDescriptor
public class DefaultCommandDescriptor
- extends Object
- implements CommandDescriptor
A command descriptor. This describes command arguments and help.
A command descriptor may be lazy this means when you need to be sure command definition is loaded
we must call #load()
before accessing command definition.
When instantiating a command using newInstance()
the definition
will be automatically loaded if needed.
Laziness avoids compiling script commands at startup.
TODO: support for "bundle:" scripts
- Author:
- Bogdan Stefanescu
options
public CommandOption[] options
params
public CommandParameter[] params
DefaultCommandDescriptor
public DefaultCommandDescriptor()
DefaultCommandDescriptor
public DefaultCommandDescriptor(String name,
Class<?> klass)
isDynamicScript
public boolean isDynamicScript()
- Specified by:
isDynamicScript
in interface CommandDescriptor
hasOptions
public boolean hasOptions()
- Specified by:
hasOptions
in interface CommandDescriptor
hasArguments
public boolean hasArguments()
- Specified by:
hasArguments
in interface CommandDescriptor
toString
public String toString()
- Overrides:
toString
in class Object
getAliases
public String[] getAliases()
- Specified by:
getAliases
in interface CommandDescriptor
getDescription
public String getDescription()
- Specified by:
getDescription
in interface CommandDescriptor
getHelp
public String getHelp()
- Specified by:
getHelp
in interface CommandDescriptor
getName
public String getName()
- Specified by:
getName
in interface CommandDescriptor
getOptions
public CommandOption[] getOptions()
- Specified by:
getOptions
in interface CommandDescriptor
getArguments
public CommandParameter[] getArguments()
- Specified by:
getArguments
in interface CommandDescriptor
setParams
public void setParams(CommandParameter[] params)
setHelp
public void setHelp(String help)
setDescription
public void setDescription(String description)
setAliases
public void setAliases(String[] aliases)
setOptions
public void setOptions(CommandOption[] options)
compareTo
public int compareTo(CommandDescriptor o)
- Specified by:
compareTo
in interface Comparable<CommandDescriptor>
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
newInstance
public Command newInstance()
throws Exception
- Specified by:
newInstance
in interface CommandDescriptor
- Throws:
Exception
Copyright © 2011 Nuxeo SAS. All Rights Reserved.