Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.shell
Class DefaultCommandDescriptor

java.lang.Object
  extended by 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

Field Summary
 CommandOption[] options
           
 CommandParameter[] params
           
 
Constructor Summary
DefaultCommandDescriptor()
           
DefaultCommandDescriptor(java.lang.String name, java.lang.Class<?> klass)
           
 
Method Summary
 int compareTo(CommandDescriptor o)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String[] getAliases()
           
 CommandParameter[] getArguments()
           
 java.lang.String getDescription()
           
 java.lang.String getHelp()
           
 java.lang.String getName()
           
 CommandOption[] getOptions()
           
 boolean hasArguments()
           
 int hashCode()
           
 boolean hasOptions()
           
 boolean isDynamicScript()
           
 Command newInstance()
           
 void setAliases(java.lang.String[] aliases)
           
 void setDescription(java.lang.String description)
           
 void setHelp(java.lang.String help)
           
 void setOptions(CommandOption[] options)
           
 void setParams(CommandParameter[] params)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

options

public CommandOption[] options

params

public CommandParameter[] params
Constructor Detail

DefaultCommandDescriptor

public DefaultCommandDescriptor()

DefaultCommandDescriptor

public DefaultCommandDescriptor(java.lang.String name,
                                java.lang.Class<?> klass)
Method Detail

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

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.