Class ParsingException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- net.kyori.adventure.text.minimessage.ParsingException
-
- All Implemented Interfaces:
java.io.Serializable
@NonExtendable public abstract class ParsingException extends java.lang.RuntimeException
An exception thrown when an error occurs while parsing a MiniMessage string.- Since:
- 4.10.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOCATION_UNKNOWN
-
Constructor Summary
Constructors Modifier Constructor Description protected
ParsingException(@Nullable java.lang.String message)
Create a new parsing exception with only a message.protected
ParsingException(@Nullable java.lang.String message, @Nullable java.lang.Throwable cause)
Create a new parsing exception with a message and an optional cause.protected
ParsingException(java.lang.String message, java.lang.Throwable cause, boolean enableSuppression, boolean writableStackTrace)
Create a new parsing exception with a message and an optional cause.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract @Nullable java.lang.String
detailMessage()
Get the detail message optionally passed with this exception.abstract int
endIndex()
Get the end index of the location which caused this exception.abstract @NotNull java.lang.String
originalText()
Get the input message which caused this exception.abstract int
startIndex()
Get the start index of the location which caused this exception.
-
-
-
Field Detail
-
LOCATION_UNKNOWN
public static final int LOCATION_UNKNOWN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ParsingException
protected ParsingException(@Nullable @Nullable java.lang.String message)
Create a new parsing exception with only a message.- Parameters:
message
- a detail message describing the error- Since:
- 4.10.0
-
ParsingException
protected ParsingException(@Nullable @Nullable java.lang.String message, @Nullable @Nullable java.lang.Throwable cause)
Create a new parsing exception with a message and an optional cause.- Parameters:
message
- a detail message describing the errorcause
- the cause- Since:
- 4.10.0
-
ParsingException
protected ParsingException(java.lang.String message, java.lang.Throwable cause, boolean enableSuppression, boolean writableStackTrace)
Create a new parsing exception with a message and an optional cause.- Parameters:
message
- a detail message describing the errorcause
- the causeenableSuppression
- whether suppression is enabled or disabledwritableStackTrace
- whether the stack trace should be writable- Since:
- 4.13.0
-
-
Method Detail
-
originalText
@NotNull public abstract @NotNull java.lang.String originalText()
Get the input message which caused this exception.- Returns:
- the original input message
- Since:
- 4.10.0
-
detailMessage
@Nullable public abstract @Nullable java.lang.String detailMessage()
Get the detail message optionally passed with this exception.Unlike
Throwable.getMessage()
, this method does not include location information.- Returns:
- the detail message passed to this exception
- Since:
- 4.10.0
-
startIndex
public abstract int startIndex()
Get the start index of the location which caused this exception.This index is an index into
originalText()
. If location is unknown,LOCATION_UNKNOWN
will be returned instead.- Returns:
- the start index
- Since:
- 4.10.0
-
endIndex
public abstract int endIndex()
Get the end index of the location which caused this exception.This index is an index into
originalText()
. If location is unknown,LOCATION_UNKNOWN
will be returned instead.- Returns:
- the end index
- Since:
- 4.10.0
-
-