Package dev.omnist.oml
Class OmlParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.omnist.oml.OmlParseException
- All Implemented Interfaces:
Serializable
Structured exception thrown when an OML document fails to parse (omnist-spec ยง8).
Callers that need to surface parse errors to users should inspect:
getLine()andgetColumn()โ the 1-based source locationgetCode()โ a machine-readable error code (e.g.parse.unterminated-string)Throwable.getMessage()โ a human-readable message combining location, code, and description
This exception is thrown by OmlLexer and OmlReader for any lexical
or structural violation, including unterminated strings, unexpected tokens, reserved-word
labels, empty arrays, and exceeded safety limits.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOmlParseException(int line, int column, String code, String message) Constructs an OML parse exception with full location and code details.OmlParseException(int line, int column, String code, String diagnosticPath, String message) Constructs an OML parse exception whose diagnostic path is a Document path rather than a text position, as E-11 requires for thedocument.*family (for exampledocument.limit.depth). -
Method Summary
Modifier and TypeMethodDescriptiongetCode()Returns the machine-readable error code identifying the violation category, e.g.intReturns the 1-based column number in the OML source where the error was detected.intgetLine()Returns the 1-based line number in the OML source where the error was detected.getPath()Returns a location string in the form"line:column", identical to the prefix ofThrowable.getMessage().Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OmlParseException
Constructs an OML parse exception with full location and code details.- Parameters:
line- 1-based line number in the OML source where the error was detectedcolumn- 1-based column number in the OML source where the error was detectedcode- machine-readable error code identifying the violation category, e.g.parse.unterminated-string,document.limit.depthmessage- human-readable description of the error
-
OmlParseException
Constructs an OML parse exception whose diagnostic path is a Document path rather than a text position, as E-11 requires for thedocument.*family (for exampledocument.limit.depth). The line and column still locate the failure in the message.- Parameters:
line- 1-based line number where the error was detectedcolumn- 1-based column number where the error was detectedcode- machine-readable error codediagnosticPath- the diagnostic path:line:colforparse.*, a Document path such as$.nfordocument.*message- human-readable description of the violation
-
-
Method Details
-
getLine
public int getLine()Returns the 1-based line number in the OML source where the error was detected. -
getColumn
public int getColumn()Returns the 1-based column number in the OML source where the error was detected. -
getCode
Returns the machine-readable error code identifying the violation category, e.g.parse.unterminated-stringordocument.limit.int-digits. -
getPath
Returns a location string in the form"line:column", identical to the prefix ofThrowable.getMessage().
-