org.crsh.cmdline.spi
Interface Completer

All Known Implementing Classes:
EmptyCompleter, EnumCompleter, JCRCommand

public interface Completer

A completer provides completion suffixes for a given prefix. The cmdline framework uses it when computing a completion.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 Map<String,Boolean> complete(ParameterDescriptor<?> parameter, String prefix)
          Query the completer for a set of completion for the given prefix.
 

Method Detail

complete

Map<String,Boolean> complete(ParameterDescriptor<?> parameter,
                             String prefix)
                             throws Exception

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

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.