org.crsh.shell.impl.command.system
Class SystemResolver

java.lang.Object
  extended by org.crsh.shell.impl.command.system.SystemResolver
All Implemented Interfaces:
CommandResolver

public class SystemResolver
extends Object
implements CommandResolver

Author:
Julien Viet

Field Summary
private static HashMap<String,Class<? extends BaseCommand>> commands
          .
private static HashMap<String,String> descriptions
          .
static SystemResolver INSTANCE
          .
 
Constructor Summary
private SystemResolver()
           
 
Method Summary
private
<C extends BaseCommand>
CommandResolution
createCommand(Class<C> commandClass)
           
 Iterable<Map.Entry<String,String>> getDescriptions()
           
 Command<?> resolveCommand(String name)
          Attempt to obtain a command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final SystemResolver INSTANCE
.


commands

private static final HashMap<String,Class<? extends BaseCommand>> commands
.


descriptions

private static final HashMap<String,String> descriptions
.

Constructor Detail

SystemResolver

private SystemResolver()
Method Detail

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

createCommand

private <C extends BaseCommand> CommandResolution createCommand(Class<C> commandClass)
                                 throws CommandException
Throws:
CommandException


Copyright © 2015 eXo Platform SAS. All Rights Reserved.