org.crsh.lang.groovy.command
Class GroovyScriptShellCommand<T extends GroovyScriptCommand>

java.lang.Object
  extended by org.crsh.shell.impl.command.spi.ShellCommand<Instance<T>>
      extended by org.crsh.lang.groovy.command.GroovyScriptShellCommand<T>

public class GroovyScriptShellCommand<T extends GroovyScriptCommand>
extends ShellCommand<Instance<T>>

Author:
Julien Viet

Field Summary
private  Class<T> clazz
          .
private  CommandDescriptor<Instance<T>> descriptor
          .
private  boolean hasExplicitReturn
          .
 
Constructor Summary
GroovyScriptShellCommand(Class<T> clazz)
           
 
Method Summary
private  T createCommand()
           
protected  Completer getCompleter(RuntimeContext context)
          Returns a completer for this command.
 CommandDescriptor<Instance<T>> getDescriptor()
          Returns the command descriptor.
private  CommandInvoker<Void,Object> getInvoker(String[] args)
           
protected  Command<?,?> resolveCommand(InvocationMatch<Instance<T>> match)
          Resolve the real command for a specified invocation match.
 
Methods inherited from class org.crsh.shell.impl.command.spi.ShellCommand
complete, describe, describe, resolveCommand, resolveInvoker, resolveInvoker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clazz

private final Class<T extends GroovyScriptCommand> clazz
.


hasExplicitReturn

private final boolean hasExplicitReturn
.


descriptor

private final CommandDescriptor<Instance<T extends GroovyScriptCommand>> descriptor
.

Constructor Detail

GroovyScriptShellCommand

public GroovyScriptShellCommand(Class<T> clazz)
Method Detail

getDescriptor

public CommandDescriptor<Instance<T>> getDescriptor()
Description copied from class: ShellCommand
Returns the command descriptor.

Specified by:
getDescriptor in class ShellCommand<Instance<T extends GroovyScriptCommand>>
Returns:
the descriptor

resolveCommand

protected Command<?,?> resolveCommand(InvocationMatch<Instance<T>> match)
Description copied from class: ShellCommand
Resolve the real command for a specified invocation match.

Specified by:
resolveCommand in class ShellCommand<Instance<T extends GroovyScriptCommand>>
Parameters:
match - the match
Returns:
the command

createCommand

private T createCommand()
                                             throws CommandCreationException
Throws:
CommandCreationException

getCompleter

protected Completer getCompleter(RuntimeContext context)
                          throws CommandCreationException
Description copied from class: ShellCommand
Returns a completer for this command.

Specified by:
getCompleter in class ShellCommand<Instance<T extends GroovyScriptCommand>>
Parameters:
context - the related runtime context
Returns:
the completer
Throws:
CommandCreationException - anything that would prevent completion to happen

getInvoker

private CommandInvoker<Void,Object> getInvoker(String[] args)
                                        throws CommandCreationException
Throws:
CommandCreationException


Copyright © 2014 eXo Platform SAS. All Rights Reserved.