org.nuxeo.ecm.shell
Class DefaultCommandDescriptor
java.lang.Object
org.nuxeo.ecm.shell.DefaultCommandDescriptor
- All Implemented Interfaces:
- java.lang.Comparable<CommandDescriptor>, CommandDescriptor
public class DefaultCommandDescriptor
- extends java.lang.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
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
options
public CommandOption[] options
params
public CommandParameter[] params
DefaultCommandDescriptor
public DefaultCommandDescriptor()
DefaultCommandDescriptor
public DefaultCommandDescriptor(java.lang.String name,
java.lang.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 java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getAliases
public java.lang.String[] getAliases()
- Specified by:
getAliases
in interface CommandDescriptor
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interface CommandDescriptor
getHelp
public java.lang.String getHelp()
- Specified by:
getHelp
in interface CommandDescriptor
getName
public java.lang.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(java.lang.String help)
setDescription
public void setDescription(java.lang.String description)
setAliases
public void setAliases(java.lang.String[] aliases)
setOptions
public void setOptions(CommandOption[] options)
compareTo
public int compareTo(CommandDescriptor o)
- Specified by:
compareTo
in interface java.lang.Comparable<CommandDescriptor>
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
newInstance
public Command newInstance()
throws java.lang.Exception
- Specified by:
newInstance
in interface CommandDescriptor
- Throws:
java.lang.Exception
Copyright © 2010 Nuxeo SAS. All Rights Reserved.