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:
Serializable
Whenever any issue in Parser occurs. Usually thrown using
ASSERT(boolean, String) and @ASSERT(boolean, Supplier, String).- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionParserException(String message) Construct a Parser Exception without a file pointer.ParserException(String message, FilePointer ptr) Construct a Parser Exception with a file pointer. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidMake sure a condition is met, else throw an exception with a given message.static voidASSERT(boolean check, Supplier<FilePointer> ptr, String elseMessage) Make sure a condition is met, else throw an exception with a given message.static voidASSERT(boolean check, FilePointer ptr, 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, toString
-
Constructor Details
-
ParserException
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, String elseMessage) throws ParserException Make 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, Supplier<FilePointer> ptr, String elseMessage) throws ParserException Make 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.
-