org.crsh.command
Class CRaSHCommand

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by org.crsh.command.GroovyCommand
          extended by org.crsh.command.CRaSHCommand
All Implemented Interfaces:
groovy.lang.GroovyObject, ShellCommand
Direct Known Subclasses:
JCRCommand

public abstract class CRaSHCommand
extends GroovyCommand
implements ShellCommand

A real CRaSH command, the most powerful kind of command.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
protected CRaSHCommand()
           
 
Method Summary
 Map<String,String> complete(CommandContext context, String line)
          Provide completions for the specified arguments.
 CommandInvoker<?,?> createInvoker(String line)
          Provides an invoker for the specified arguments.
 String describe(String line, DescriptionMode mode)
          Returns a description of the command or null if none can be found.
protected  CommandContext getContext()
           
 String getUnmatched()
           
 boolean getUnquoteArguments()
          Returns true if the command wants its arguments to be unquoted.
protected  String readLine(String msg)
           
protected  String readLine(String msg, boolean echo)
           
 void setUnquoteArguments(boolean unquoteArguments)
           
 
Methods inherited from class org.crsh.command.GroovyCommand
getProperty, invokeMethod, setProperty
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRaSHCommand

protected CRaSHCommand()
                throws IntrospectionException
Throws:
IntrospectionException
Method Detail

getUnquoteArguments

public final boolean getUnquoteArguments()
Returns true if the command wants its arguments to be unquoted.

Returns:
true if arguments must be unquoted

setUnquoteArguments

public final void setUnquoteArguments(boolean unquoteArguments)

readLine

protected final String readLine(String msg)

readLine

protected final String readLine(String msg,
                                boolean echo)

getUnmatched

public final String getUnmatched()

getContext

protected final CommandContext getContext()
Specified by:
getContext in class GroovyCommand

complete

public final Map<String,String> complete(CommandContext context,
                                         String line)
Description copied from interface: ShellCommand
Provide completions for the specified arguments.

Specified by:
complete in interface ShellCommand
Parameters:
context - the command context
line - the original command line arguments
Returns:
the completions

describe

public final String describe(String line,
                             DescriptionMode mode)
Description copied from interface: ShellCommand
Returns a description of the command or null if none can be found.

Specified by:
describe in interface ShellCommand
Parameters:
line - the usage line
mode - the description mode
Returns:
the description

createInvoker

public final CommandInvoker<?,?> createInvoker(String line)
Description copied from interface: ShellCommand
Provides an invoker for the specified arguments.

Specified by:
createInvoker in interface ShellCommand
Parameters:
line - the command line arguments
Returns:
the command to provide


Copyright © 2011 eXo Platform SAS. All Rights Reserved.