Package revxrsal.commands.exception
Class ArgumentParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
revxrsal.commands.exception.ArgumentParseException
- All Implemented Interfaces:
Serializable
Exception thrown when an error occurs while parsing arguments.
- See Also:
-
Constructor Summary
ConstructorDescriptionArgumentParseException
(String message, String source, int position) Return a newArgumentParseException
with the given message, source and position.ArgumentParseException
(String message, Throwable cause, String source, int position) Return a newArgumentParseException
with the given message, cause, source and position. -
Method Summary
Modifier and TypeMethodDescriptionReturn a string pointing to the position of the arguments when this exception occurs.int
Gets the position of the last fetched argument in the provided source string.Returns the source string arguments are being parsed from.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ArgumentParseException
Return a newArgumentParseException
with the given message, source and position.- Parameters:
message
- The message to use for this exceptionsource
- The source string being parsedposition
- The current position in the source string
-
ArgumentParseException
Return a newArgumentParseException
with the given message, cause, source and position.- Parameters:
message
- The message to use for this exceptioncause
- The cause for this exceptionsource
- The source string being parsedposition
- The current position in the source string
-
-
Method Details
-
getAnnotatedPosition
Return a string pointing to the position of the arguments when this exception occurs.- Returns:
- The appropriate position string
-
getPosition
public int getPosition()Gets the position of the last fetched argument in the provided source string.- Returns:
- The source string to get position for
-
getSourceString
Returns the source string arguments are being parsed from.- Returns:
- The source string
-