class RegexCompletor extends java.lang.Object implements jline.console.completer.Completer
JLine Completor that accepts a string if it matches a given regular expression pattern.
Modifiers | Name | Description |
---|---|---|
private java.util.regex.Pattern |
pattern |
Type | Name and description |
---|---|
java.util.regex.Pattern |
pattern |
Constructor and description |
---|
RegexCompletor
(java.lang.String pattern) |
RegexCompletor
(java.util.regex.Pattern pattern) |
Type Params | Return Type | Name and description |
---|---|---|
|
int |
complete(java.lang.String buffer, int cursor, java.util.List candidates) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Check whether the whole buffer matches the configured pattern. If it does, the buffer is added to the candidates list (which indicates acceptance of the buffer string) and returns 0, i.e. the start of the buffer. This mimics the behaviour of SimpleCompletor.
If the buffer doesn't match the configured pattern, this returns -1 and the candidates list is left empty.
Groovy Documentation