Class SNBTException
java.lang.Object
java.lang.Throwable
java.lang.Exception
de.pauleff.formats.snbt.SNBTException
- All Implemented Interfaces:
Serializable
Exception thrown when parsing or generating SNBT (Stringified NBT) data fails.
Provides position information for better error reporting.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSNBTException(String message) Creates an SNBT exception with a message.SNBTException(String message, int position, String input) Creates an SNBT exception with position information.SNBTException(String message, int position, String input, Throwable cause) Creates an SNBT exception with position information and underlying cause.SNBTException(String message, Throwable cause) Creates an SNBT exception with a message and underlying cause. -
Method Summary
Modifier and TypeMethodDescriptiongetInput()Returns the input string that was being parsed when the error occurred.intReturns the character position where the error occurred.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SNBTException
Creates an SNBT exception with a message.- Parameters:
message- the error message
-
SNBTException
-
SNBTException
-
SNBTException
Creates an SNBT exception with position information and underlying cause.- Parameters:
message- the error messageposition- the character position where the error occurredinput- the input string being parsedcause- the underlying exception that caused this error
-
-
Method Details
-
getPosition
public int getPosition()Returns the character position where the error occurred.- Returns:
- the error position, or -1 if not available
-
getInput
Returns the input string that was being parsed when the error occurred.- Returns:
- the input string, or null if not available
-