Class ArgumentParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.spongepowered.api.util.ComponentMessageException
org.spongepowered.api.command.exception.CommandException
org.spongepowered.api.command.exception.ArgumentParseException
- All Implemented Interfaces:
Serializable,ComponentMessageThrowable
Exception thrown when a
Parameter cannot parse an argument.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionArgumentParseException(@Nullable Component message, String source, int position) Return a newArgumentParseExceptionwith the given message, source and position.ArgumentParseException(@Nullable Component message, Throwable cause, String source, int position) Return a newArgumentParseExceptionwith 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.@Nullable ComponentReturns the text message for this exception, or null if nothing is present.intposition()Gets the position of the last fetched argument in the provided source string.Returns the source string arguments are being parsed from.@Nullable ComponentMethods inherited from class org.spongepowered.api.command.exception.CommandException
shouldIncludeUsageMethods inherited from class org.spongepowered.api.util.ComponentMessageException
getLocalizedMessage, getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ArgumentParseException
Return a newArgumentParseExceptionwith 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
public ArgumentParseException(@Nullable Component message, Throwable cause, String source, int position) Return a newArgumentParseExceptionwith 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
-
componentMessage
Description copied from class:ComponentMessageExceptionReturns the text message for this exception, or null if nothing is present.- Specified by:
componentMessagein interfaceComponentMessageThrowable- Overrides:
componentMessagein classComponentMessageException- Returns:
- The text for this message
-
superText
-
annotatedPosition
Return a string pointing to the position of the arguments when this exception occurs.- Returns:
- The appropriate position string
-
position
public int position()Gets the position of the last fetched argument in the provided source string.- Returns:
- The source string to get position for
-
sourceString
Returns the source string arguments are being parsed from.- Returns:
- The source string
-