E - The type of the executorpublic class StringType<E> extends java.lang.Object implements ArgumentType<E,java.lang.String>
Type#WORD - A single wordType#STRING - A single word or a string surrounded by single or double quotesType#GREEDY_STRING - A string that contains all remaining characters| Modifier and Type | Method and Description |
|---|---|
int |
getWeight() |
static <E> StringType<E> |
greedyString()
Create a new string type that parses a string that contains all remaining characters.
|
void |
parseCompletions(java.util.Set<java.lang.String> completions,
ExecutionContext<E> executionContext,
StringReader stringReader)
Provide the completions of this argument.
|
java.lang.String |
parseValue(ExecutionContext<E> executionContext,
StringReader stringReader)
Parses the value of the argument.
|
static <E> StringType<E> |
string()
Create a new string type that parses a single word or a string surrounded by single or double quotes.
|
static <E> StringType<E> |
word()
Create a new string type that parses a single word.
|
public static <E> StringType<E> word()
E - The type of the executorpublic static <E> StringType<E> string()
E - The type of the executorpublic static <E> StringType<E> greedyString()
E - The type of the executorpublic int getWeight()
getWeight in interface ArgumentType<E,java.lang.String>@Nonnull public java.lang.String parseValue(ExecutionContext<E> executionContext, StringReader stringReader) throws ArgumentParseException, java.lang.RuntimeException
ArgumentTypeparseValue in interface ArgumentType<E,java.lang.String>executionContext - The execution contextstringReader - The string readerArgumentParseException - If the value could not be parsedjava.lang.RuntimeException - If an unexpected error occurredpublic void parseCompletions(java.util.Set<java.lang.String> completions,
ExecutionContext<E> executionContext,
StringReader stringReader)
ArgumentTypeparseCompletions in interface ArgumentType<E,java.lang.String>completions - The set of completionsexecutionContext - The execution contextstringReader - The string reader