Class ParsingExceptionImpl
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.kyori.adventure.text.minimessage.ParsingException
net.kyori.adventure.text.minimessage.internal.parser.ParsingExceptionImpl
- All Implemented Interfaces:
Serializable
An exception that happens while parsing.
- Since:
- 4.10.0
- See Also:
-
Field Summary
Fields inherited from class ParsingException
LOCATION_UNKNOWN -
Constructor Summary
ConstructorsConstructorDescriptionParsingExceptionImpl(String message, @Nullable String originalText, @Nullable Throwable cause, boolean withStackTrace, Token... tokens) Create a new parsing exception.ParsingExceptionImpl(String message, @Nullable String originalText, Token... tokens) Create a new parsing exception. -
Method Summary
Modifier and TypeMethodDescription@Nullable StringGet the detail message optionally passed with this exception.intendIndex()Get the end index of the location which caused this exception.@Nullable StringGet the message which caused this exception.intGet the start index of the location which caused this exception.Token[]tokens()Gets the tokens associated with this parsing error.voidSets the tokens associated with this parsing error.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParsingExceptionImpl
-
ParsingExceptionImpl
public ParsingExceptionImpl(String message, @Nullable String originalText, @Nullable Throwable cause, boolean withStackTrace, Token... tokens) Create a new parsing exception.- Parameters:
message- the detail messageoriginalText- the original text which was parsedcause- the causewithStackTrace- whether to generate a stacktracetokens- the token which caused the error- Since:
- 4.10.0
-
-
Method Details
-
getMessage
- Overrides:
getMessagein classThrowable
-
detailMessage
Description copied from class:ParsingExceptionGet the detail message optionally passed with this exception.Unlike
Throwable.getMessage(), this method does not include location information.- Specified by:
detailMessagein classParsingException- Returns:
- the detail message passed to this exception
-
originalText
Get the message which caused this exception.- Specified by:
originalTextin classParsingException- Returns:
- the original message
- Since:
- 4.10.0
-
tokens
Gets the tokens associated with this parsing error.- Returns:
- the tokens for this error
- Since:
- 4.10.0
-
tokens
Sets the tokens associated with this parsing error.- Parameters:
tokens- the tokens for this error- Since:
- 4.10.0
-
startIndex
public int startIndex()Description copied from class:ParsingExceptionGet the start index of the location which caused this exception.This index is an index into
ParsingException.originalText(). If location is unknown,ParsingException.LOCATION_UNKNOWNwill be returned instead.- Specified by:
startIndexin classParsingException- Returns:
- the start index
-
endIndex
public int endIndex()Description copied from class:ParsingExceptionGet the end index of the location which caused this exception.This index is an index into
ParsingException.originalText(). If location is unknown,ParsingException.LOCATION_UNKNOWNwill be returned instead.- Specified by:
endIndexin classParsingException- Returns:
- the end index
-