Class ArgumentParseException

All Implemented Interfaces:
Serializable, ComponentMessageThrowable

public class ArgumentParseException extends CommandException
Exception thrown when a Parameter cannot parse an argument.
See Also:
  • Constructor Details

    • ArgumentParseException

      public ArgumentParseException(@Nullable Component message, String source, int position)
      Return a new ArgumentParseException with the given message, source and position.
      Parameters:
      message - The message to use for this exception
      source - The source string being parsed
      position - The current position in the source string
    • ArgumentParseException

      public ArgumentParseException(@Nullable Component message, Throwable cause, String source, int position)
      Return a new ArgumentParseException with the given message, cause, source and position.
      Parameters:
      message - The message to use for this exception
      cause - The cause for this exception
      source - The source string being parsed
      position - The current position in the source string
  • Method Details

    • componentMessage

      public @Nullable Component componentMessage()
      Description copied from class: ComponentMessageException
      Returns the text message for this exception, or null if nothing is present.
      Specified by:
      componentMessage in interface ComponentMessageThrowable
      Overrides:
      componentMessage in class ComponentMessageException
      Returns:
      The text for this message
    • superText

      public @Nullable Component superText()
    • annotatedPosition

      public String 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

      public String sourceString()
      Returns the source string arguments are being parsed from.
      Returns:
      The source string