Modifier and Type | Class | Description |
---|---|---|
class |
DefaultParser.ArgumentList |
The result of a delimited buffer.
|
static class |
DefaultParser.Bracket |
Parser.ParseContext
REGEX_COMMAND, REGEX_VARIABLE
Constructor | Description |
---|---|
DefaultParser() |
Modifier and Type | Method | Description |
---|---|---|
DefaultParser |
commandGroup(int commandGroup) |
|
DefaultParser |
eofOnEscapedNewLine(boolean eofOnEscapedNewLine) |
|
DefaultParser |
eofOnUnclosedBracket(DefaultParser.Bracket... brackets) |
|
DefaultParser |
eofOnUnclosedQuote(boolean eofOnUnclosedQuote) |
|
DefaultParser |
escapeChars(char[] chars) |
|
String |
getCommand(String line) |
|
char[] |
getEscapeChars() |
|
char[] |
getQuoteChars() |
|
String |
getVariable(String line) |
|
boolean |
isDelimiter(CharSequence buffer,
int pos) |
Returns true if the specified character is a whitespace parameter.
|
boolean |
isDelimiterChar(CharSequence buffer,
int pos) |
Returns true if the character at the specified position if a delimiter.
|
boolean |
isEofOnEscapedNewLine() |
|
boolean |
isEofOnUnclosedQuote() |
|
boolean |
isEscapeChar(char ch) |
|
boolean |
isEscapeChar(CharSequence buffer,
int pos) |
Check if this character is a valid escape char (i.e.
|
boolean |
isEscaped(CharSequence buffer,
int pos) |
Check if a character is escaped (i.e.
|
boolean |
isQuoteChar(CharSequence buffer,
int pos) |
|
boolean |
isQuoted(CharSequence buffer,
int pos) |
|
ParsedLine |
parse(String line,
int cursor,
Parser.ParseContext context) |
|
DefaultParser |
quoteChars(char[] chars) |
|
DefaultParser |
regexCommand(String regexCommand) |
|
DefaultParser |
regexVariable(String regexVariable) |
|
void |
setCommandGroup(int commandGroup) |
|
void |
setEofOnEscapedNewLine(boolean eofOnEscapedNewLine) |
|
void |
setEofOnUnclosedBracket(DefaultParser.Bracket... brackets) |
|
void |
setEofOnUnclosedQuote(boolean eofOnUnclosedQuote) |
|
void |
setEscapeChars(char[] chars) |
|
void |
setQuoteChars(char[] chars) |
|
void |
setRegexCommand(String regexCommand) |
|
void |
setRegexVariable(String regexVariable) |
|
boolean |
validCommandName(String name) |
|
boolean |
validVariableName(String name) |
public DefaultParser quoteChars(char[] chars)
public DefaultParser escapeChars(char[] chars)
public DefaultParser eofOnUnclosedQuote(boolean eofOnUnclosedQuote)
public DefaultParser eofOnUnclosedBracket(DefaultParser.Bracket... brackets)
public DefaultParser eofOnEscapedNewLine(boolean eofOnEscapedNewLine)
public DefaultParser regexVariable(String regexVariable)
public DefaultParser regexCommand(String regexCommand)
public DefaultParser commandGroup(int commandGroup)
public void setQuoteChars(char[] chars)
public char[] getQuoteChars()
public void setEscapeChars(char[] chars)
public char[] getEscapeChars()
public void setEofOnUnclosedQuote(boolean eofOnUnclosedQuote)
public boolean isEofOnUnclosedQuote()
public void setEofOnEscapedNewLine(boolean eofOnEscapedNewLine)
public boolean isEofOnEscapedNewLine()
public void setEofOnUnclosedBracket(DefaultParser.Bracket... brackets)
public void setRegexVariable(String regexVariable)
public void setRegexCommand(String regexCommand)
public void setCommandGroup(int commandGroup)
public boolean validCommandName(String name)
validCommandName
in interface Parser
public boolean validVariableName(String name)
validVariableName
in interface Parser
public String getCommand(String line)
getCommand
in interface Parser
public String getVariable(String line)
getVariable
in interface Parser
public ParsedLine parse(String line, int cursor, Parser.ParseContext context)
public boolean isDelimiter(CharSequence buffer, int pos)
getQuoteChars()
, and is not escaped by any of the getEscapeChars()
, and
returns true from isDelimiterChar(java.lang.CharSequence, int)
.buffer
- The complete command bufferpos
- The index of the character in the bufferpublic boolean isQuoted(CharSequence buffer, int pos)
public boolean isQuoteChar(CharSequence buffer, int pos)
public boolean isEscapeChar(char ch)
isEscapeChar
in interface Parser
public boolean isEscapeChar(CharSequence buffer, int pos)
buffer
- the buffer to check inpos
- the position of the character to checkpublic boolean isEscaped(CharSequence buffer, int pos)
buffer
- the buffer to check inpos
- the position of the character to checkpublic boolean isDelimiterChar(CharSequence buffer, int pos)
getQuoteChars()
, and is not escaped by any of the
getEscapeChars()
. To perform escaping manually, override isDelimiter(java.lang.CharSequence, int)
instead.buffer
- the buffer to check inpos
- the position of the character to checkCopyright © 2020. All rights reserved.