public class ArgumentParseException extends CommandException
Modifier and Type | Class and Description |
---|---|
static class |
ArgumentParseException.WithUsage
An
ArgumentParseException where the usage is already specified. |
Constructor and Description |
---|
ArgumentParseException(Text message,
String source,
int position)
Return a new
ArgumentParseException with the given message, source and position. |
ArgumentParseException(Text message,
Throwable cause,
String source,
int position)
Return a new
ArgumentParseException with the given message, cause, source and position. |
Modifier and Type | Method and Description |
---|---|
String |
getAnnotatedPosition()
Return a string pointing to the position of the arguments when this
exception occurs.
|
int |
getPosition()
Gets the position of the last fetched argument in the provided source
string.
|
String |
getSourceString()
Returns the source string arguments are being parsed from.
|
Text |
getText()
Returns the text message for this exception, or null if nothing is
present.
|
shouldIncludeUsage
getLocalizedMessage, getMessage
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ArgumentParseException(Text message, String source, int position)
ArgumentParseException
with the given message, source and position.message
- The message to use for this exceptionsource
- The source string being parsedposition
- The current position in the source stringpublic ArgumentParseException(Text message, Throwable cause, String source, int position)
ArgumentParseException
with the given message, cause, source and position.message
- The message to use for this exceptioncause
- The cause for this exceptionsource
- The source string being parsedposition
- The current position in the source stringpublic Text getText()
TextMessageException
getText
in class TextMessageException
public String getAnnotatedPosition()
public int getPosition()
public String getSourceString()