org.crsh.cmdline
Class EnumCompleter

java.lang.Object
  extended by org.crsh.cmdline.EnumCompleter
All Implemented Interfaces:
Completer

public class EnumCompleter
extends Object
implements Completer

A completer for enums.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
EnumCompleter()
           
 
Method Summary
 Map<String,Boolean> complete(ParameterDescriptor<?> parameter, String prefix)
          Query the completer for a set of completion for the given prefix.
static EnumCompleter getInstance()
          Returns the empty completer instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumCompleter

public EnumCompleter()
Method Detail

getInstance

public static EnumCompleter getInstance()
Returns the empty completer instance.

Returns:
the instance

complete

public Map<String,Boolean> complete(ParameterDescriptor<?> parameter,
                                    String prefix)
                             throws Exception
Description copied from interface: Completer

Query the completer for a set of completion for the given prefix. The returned Map should provide the possible suffixes matching the prefix argument. Each map entry maps to a possible completion: an entry key is the possible completion, its corresponding boolean value indicates wether the value can be further more completed or not. The following guidelines should be respected:

Example: a completer that would complete colors could

Example: a completer that would complete java packages could

Specified by:
complete in interface Completer
Parameters:
parameter - the completed parameter
prefix - the prefix to complete
Returns:
the possible suffix map
Throws:
Exception - any exception that would prevent completion to perform correctly


Copyright © 2011 eXo Platform SAS. All Rights Reserved.