Class LogicalTypesParserFactory
java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.LogicalTypesParserFactory
Centralized factory for building lexer + parser instances configured with a
strict error listener that throws
ValidationException on the first
syntax error.
ANTLR's default ConsoleErrorListener writes errors to stderr and
lets the parser silently recover by inserting/deleting tokens. For a DDL
grammar — and especially for CHECK (...) sub-expressions where
recovery can leak past the closing paren and corrupt subsequent fields —
silent recovery produces partially-formed parse trees that translate to
confusing downstream errors (or worse, to incorrect CEL).
This factory replaces the default listener with one that aborts on the
first syntax error, surfacing a single clear message with line and column.
All callers (production and tests) should route through parse(String)
so the strict behavior is uniform.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LogicalTypesParserBuild aLogicalTypesParserwith the strict error listener wired in.Parse a DDL script and return its rootscriptparse tree.
-
Method Details
-
parse
Parse a DDL script and return its rootscriptparse tree. ThrowsValidationExceptionwith line/column info on the first lex or parse error encountered, or when the script nests types too deeply to parse without overflowing the recursive-descent stack. -
newParser
Build aLogicalTypesParserwith the strict error listener wired in. Use this when you need direct access to specific entry rules other thanscript()(e.g., partial parses for tooling).
-