org.crsh.lang.impl.java
Class ClassShellCommand<T extends BaseCommand>

java.lang.Object
  extended by org.crsh.shell.impl.command.spi.Command<Instance<T>>
      extended by org.crsh.lang.impl.java.ClassShellCommand<T>

public class ClassShellCommand<T extends BaseCommand>
extends Command<Instance<T>>

Author:
Julien Viet

Field Summary
private  Class<T> clazz
          .
private  CommandDescriptor<Instance<T>> descriptor
          .
 
Constructor Summary
ClassShellCommand(Class<T> clazz)
           
 
Method Summary
(package private)  T createCommand()
           
protected  Completer getCompleter(RuntimeContext context)
          Returns a completer for this command.
 CommandDescriptor<Instance<T>> getDescriptor()
          Returns the command descriptor.
private
<C,P,PC extends Pipe<C,P>>
CommandMatch<C,P>
getPipeInvoker(CommandInvoker<Instance<T>,PC> invoker)
           
private
<P> CommandMatch<Void,P>
getProducerInvoker(CommandInvoker<Instance<T>,?> invoker, Class<P> producedType)
           
protected  CommandMatch<?,?> resolve(InvocationMatch<Instance<T>> match)
          Resolve the real match for a specified invocation match.
 
Methods inherited from class org.crsh.shell.impl.command.spi.Command
complete, describe, describe, resolveCommand, resolveCommand, 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 BaseCommand> clazz
.


descriptor

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

Constructor Detail

ClassShellCommand

public ClassShellCommand(Class<T> clazz)
                  throws IntrospectionException
Throws:
IntrospectionException
Method Detail

getDescriptor

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

Specified by:
getDescriptor in class Command<Instance<T extends BaseCommand>>
Returns:
the descriptor

getCompleter

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

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

resolve

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

Specified by:
resolve in class Command<Instance<T extends BaseCommand>>
Parameters:
match - the match
Returns:
the command

createCommand

T createCommand()
                              throws CommandException
Throws:
CommandException

getPipeInvoker

private <C,P,PC extends Pipe<C,P>> CommandMatch<C,P> getPipeInvoker(CommandInvoker<Instance<T>,PC> invoker)

getProducerInvoker

private <P> CommandMatch<Void,P> getProducerInvoker(CommandInvoker<Instance<T>,?> invoker,
                                                    Class<P> producedType)


Copyright © 2015 eXo Platform SAS. All Rights Reserved.