Package net.diversionmc.parser.util
Class ParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
net.diversionmc.parser.util.ParserException
- All Implemented Interfaces:
java.io.Serializable
public class ParserException
extends java.lang.IllegalArgumentException
Whenever any issue in Parser occurs. Usually thrown using
ASSERT(boolean, String) and @ASSERT(boolean, Supplier, String).- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ParserException(java.lang.String message)Construct a Parser Exception without a file pointer.ParserException(java.lang.String message, FilePointer ptr)Construct a Parser Exception with a file pointer. -
Method Summary
Modifier and Type Method Description static voidASSERT(boolean check, java.lang.String elseMessage)Make sure a condition is met, else throw an exception with a given message.static voidASSERT(boolean check, java.util.function.Supplier<FilePointer> ptr, java.lang.String elseMessage)Make sure a condition is met, else throw an exception with a given message.static voidASSERT(boolean check, FilePointer ptr, java.lang.String elseMessage)Make sure a condition is met, else throw an exception with a given message.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
ParserException
public ParserException(java.lang.String message)Construct a Parser Exception without a file pointer.- Parameters:
message- Error message.
-
ParserException
Construct a Parser Exception with a file pointer.- Parameters:
message- Error message.ptr- Position in the file where Parser could not proceed.
-
-
Method Details
-
ASSERT
Make sure a condition is met, else throw an exception with a given message.- Parameters:
check- Condition to ensure.elseMessage- Error message.- Throws:
ParserException- When condition is not met.
-
ASSERT
public static void ASSERT(boolean check, FilePointer ptr, java.lang.String elseMessage) throws ParserExceptionMake sure a condition is met, else throw an exception with a given message.- Parameters:
check- Condition to ensure.ptr- Position in the file where Parser could not proceed.elseMessage- Error message.- Throws:
ParserException- When condition is not met.
-
ASSERT
public static void ASSERT(boolean check, java.util.function.Supplier<FilePointer> ptr, java.lang.String elseMessage) throws ParserExceptionMake sure a condition is met, else throw an exception with a given message.- Parameters:
check- Condition to ensure.ptr- Position in the file where Parser could not proceed.elseMessage- Error message.- Throws:
ParserException- When condition is not met.
-