org.crsh.lang
Class LanguageCommandResolver

java.lang.Object
  extended by org.crsh.lang.LanguageCommandResolver
All Implemented Interfaces:
CommandResolver

public class LanguageCommandResolver
extends Object
implements CommandResolver

A shell command resolver for languages.

Author:
Julien Viet

Field Summary
(package private)  HashMap<String,Compiler> activeCompilers
          .
private  Map<String,TimestampedObject<CommandResolution>> commandCache
          .
(package private)  PluginContext context
          .
 
Constructor Summary
LanguageCommandResolver(PluginContext context)
           
 
Method Summary
 Compiler getCompiler(String name)
           
 Iterable<Map.Entry<String,String>> getDescriptions()
           
private  CommandResolution resolveCommand(Compiler manager, String name, Resource script)
           
 Command<?> resolveCommand(String name)
          Attempt to obtain a command.
private  CommandResolution resolveCommand2(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandCache

private final Map<String,TimestampedObject<CommandResolution>> commandCache
.


activeCompilers

final HashMap<String,Compiler> activeCompilers
.


context

final PluginContext context
.

Constructor Detail

LanguageCommandResolver

public LanguageCommandResolver(PluginContext context)
Method Detail

getCompiler

public Compiler getCompiler(String name)

getDescriptions

public Iterable<Map.Entry<String,String>> getDescriptions()
Specified by:
getDescriptions in interface CommandResolver
Returns:
the known command names by this resolver, the returned map keys are the command names and the values are the corresponding one line description of the command

resolveCommand

public Command<?> resolveCommand(String name)
                          throws CommandException,
                                 NullPointerException
Description copied from interface: CommandResolver
Attempt to obtain a command. Null is returned when such command does not exist.

Specified by:
resolveCommand in interface CommandResolver
Parameters:
name - the command name
Returns:
the command shell
Throws:
CommandException - if an error occured preventing the command creation
NullPointerException - if the name argument is null

resolveCommand2

private CommandResolution resolveCommand2(String name)
                                   throws CommandException,
                                          NullPointerException
Throws:
CommandException
NullPointerException

resolveCommand

private CommandResolution resolveCommand(Compiler manager,
                                         String name,
                                         Resource script)
                                  throws CommandException
Throws:
CommandException


Copyright © 2015 eXo Platform SAS. All Rights Reserved.