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


Field Summary
private  ClassDescriptor<?> descriptor
          .
private  boolean help
          .
private  org.slf4j.Logger log
          .
protected  String unmatched
          The unmatched text, only valid during an invocation.
private  boolean unquoteArguments
          .
 
Fields inherited from class org.crsh.command.GroovyCommand
context, out
 
Constructor Summary
protected CRaSHCommand()
           
 
Method Summary
 CommandCompletion complete(CommandContext context, String line)
          Provide completions for the specified arguments.
 String describe(String line, DescriptionFormat mode)
          Returns a description of the command or null if none can be found.
 ClassDescriptor<?> getDescriptor()
          Returns the command descriptor.
 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)
           
 CommandInvoker<?,?> resolveInvoker(CommandMatch<CRaSHCommand,?,?> match)
           
 CommandInvoker<?,?> resolveInvoker(String line)
          Provides an invoker for the command line specified as a command line to parse.
 CommandInvoker<?,?> resolveInvoker(String name, Map<String,?> options, List<?> args)
          Provides an invoker for the command line specified under the form of a command, options and arguments.
 void setUnquoteArguments(boolean unquoteArguments)
           
(package private) static ScriptException toScript(Throwable cause)
           
 
Methods inherited from class org.crsh.command.GroovyCommand
getProperty, invokeMethod, peekContext, popContext, pushContext, 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
 

Field Detail

log

private final org.slf4j.Logger log
.


unquoteArguments

private boolean unquoteArguments
.


descriptor

private final ClassDescriptor<?> descriptor
.


unmatched

protected String unmatched
The unmatched text, only valid during an invocation.


help

private boolean help
.

Constructor Detail

CRaSHCommand

protected CRaSHCommand()
                throws IntrospectionException
Throws:
IntrospectionException
Method Detail

getDescriptor

public ClassDescriptor<?> getDescriptor()
Returns the command descriptor.

Returns:
the command descriptor

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()

complete

public final CommandCompletion 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,
                             DescriptionFormat 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

toScript

static ScriptException toScript(Throwable cause)

resolveInvoker

public CommandInvoker<?,?> resolveInvoker(String name,
                                          Map<String,?> options,
                                          List<?> args)
Description copied from interface: ShellCommand
Provides an invoker for the command line specified under the form of a command, options and arguments.

Specified by:
resolveInvoker in interface ShellCommand
Parameters:
name - the command name, might be null
options - the options
args - the arguments
Returns:
the command

resolveInvoker

public CommandInvoker<?,?> resolveInvoker(String line)
Description copied from interface: ShellCommand
Provides an invoker for the command line specified as a command line to parse.

Specified by:
resolveInvoker in interface ShellCommand
Parameters:
line - the command line arguments
Returns:
the command

resolveInvoker

public final CommandInvoker<?,?> resolveInvoker(CommandMatch<CRaSHCommand,?,?> match)


Copyright © 2012 eXo Platform SAS. All Rights Reserved.