Package org.apache.karaf.shell.compat
Class ArgumentCompleter
- java.lang.Object
-
- org.apache.karaf.shell.compat.ArgumentCompleter
-
public class ArgumentCompleter extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArgumentCompleter.ProxyServiceCompleter
-
Field Summary
Fields Modifier and Type Field Description static StringARGUMENTS_LISTstatic StringCOMMANDS
-
Constructor Summary
Constructors Constructor Description ArgumentCompleter(CommandWithAction function, String scope, String name, boolean scoped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomplete(org.apache.karaf.shell.api.console.Session session, org.apache.karaf.shell.api.console.CommandLine list, List<String> candidates)booleangetStrict()Return whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.booleanisDelimiter(String buffer, int pos)Return true if the specified character is a whitespace parameter.booleanisDelimiterChar(String buffer, int pos)The character is a delimiter if it is whitespace, and the preceding character is not an escape character.booleanisEscaped(String buffer, int pos)voidsetStrict(boolean strict)If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.protected booleanverifyCompleter(Completer completer, String argument)
-
-
-
Field Detail
-
ARGUMENTS_LIST
public static final String ARGUMENTS_LIST
- See Also:
- Constant Field Values
-
COMMANDS
public static final String COMMANDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArgumentCompleter
public ArgumentCompleter(CommandWithAction function, String scope, String name, boolean scoped)
-
-
Method Detail
-
setStrict
public void setStrict(boolean strict)
If true, a completion at argument index N will only succeed if all the completions from 0-(N-1) also succeed.- Parameters:
strict- The new value of the strict flag.
-
getStrict
public boolean getStrict()
Return whether a completion at argument index N will success if all the completions from arguments 0-(N-1) also succeed.- Returns:
- The value of the strict flag.
-
complete
public int complete(org.apache.karaf.shell.api.console.Session session, org.apache.karaf.shell.api.console.CommandLine list, List<String> candidates)
-
isDelimiter
public boolean isDelimiter(String buffer, int pos)
Return true if the specified character is a whitespace parameter. Check to ensure that the character is not escaped and returns true fromisDelimiterChar(java.lang.String, int).- Parameters:
buffer- The complete command buffer.pos- The index of the character in the buffer.- Returns:
- True if the character should be a delimiter, false else.
-
isEscaped
public boolean isEscaped(String buffer, int pos)
-
isDelimiterChar
public boolean isDelimiterChar(String buffer, int pos)
The character is a delimiter if it is whitespace, and the preceding character is not an escape character.- Parameters:
buffer- The complete command buffer.pos- The index of the character in the buffer.- Returns:
- True if the character is a delimiter, false else.
-
-