jline

Class ArgumentCompletor.AbstractArgumentDelimiter

Enclosing Class:
ArgumentCompletor
Implemented Interfaces:
ArgumentCompletor.ArgumentDelimiter
Known Direct Subclasses:
ArgumentCompletor.WhitespaceArgumentDelimiter

public static abstract class ArgumentCompletor.AbstractArgumentDelimiter
extends java.lang.Object
implements ArgumentCompletor.ArgumentDelimiter

Abstract implementation of a delimiter that uses the isDelimiter(String,int) method to determine if a particular character should be used as a delimiter.
Author:
Marc Prud'hommeaux

Method Summary

ArgumentCompletor.ArgumentList
delimit(String buffer, int cursor)
char[]
getEscapeChars()
char[]
getQuoteChars()
boolean
isDelimiter(String buffer, int pos)
Returns true if the specified character is a whitespace parameter.
abstract boolean
isDelimiterChar(String buffer, int pos)
Returns true if the character at the specified position if a delimiter.
boolean
isEscaped(String buffer, int pos)
boolean
isQuoted(String buffer, int pos)
void
setEscapeChars(char[] escapeChars)
void
setQuoteChars(char[] quoteChars)

Method Details

delimit

public ArgumentCompletor.ArgumentList delimit(String buffer,
                                              int cursor)
Specified by:
delimit in interface ArgumentCompletor.ArgumentDelimiter

getEscapeChars

public char[] getEscapeChars()

getQuoteChars

public char[] getQuoteChars()

isDelimiter

public boolean isDelimiter(String buffer,
                           int pos)
Specified by:
isDelimiter in interface ArgumentCompletor.ArgumentDelimiter
Parameters:
buffer - the complete command buffer
pos - the index of the character in the buffer
Returns:
true if the character should be a delimiter

isDelimiterChar

public abstract boolean isDelimiterChar(String buffer,
                                        int pos)

isEscaped

public boolean isEscaped(String buffer,
                         int pos)

isQuoted

public boolean isQuoted(String buffer,
                        int pos)

setEscapeChars

public void setEscapeChars(char[] escapeChars)

setQuoteChars

public void setQuoteChars(char[] quoteChars)