Class LogicalTypesSchemaVisitor

java.lang.Object
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor<T>
io.confluent.kafka.schemaregistry.type.logical.generated.LogicalTypesBaseVisitor<Object>
io.confluent.kafka.schemaregistry.type.logical.LogicalTypesSchemaVisitor
All Implemented Interfaces:
LogicalTypesVisitor<Object>, org.antlr.v4.runtime.tree.ParseTreeVisitor<Object>

public class LogicalTypesSchemaVisitor extends LogicalTypesBaseVisitor<Object>
ANTLR visitor that converts a parsed DDL script into a LogicalType.

Visitor outputs (consumed by toLogicalType()):

  • namespace — from any NAMESPACE statement.
  • namedTypes — from each STRUCT <name> (...) or ENUM <name> (...) statement (locals).
  • externalImports — from each USING TYPE x FOR 'uri' statement; maps the typeName to the wire-format URI.
  • rootSchema — from the trailing TYPE <typeExpr> statement (or sugar-inferred when absent).

externalTypes is inferred by toLogicalType(): any NAMED_TYPE_REF FQN reachable from the root or from a local body that isn't declared locally is treated as external. There is no syntactic marker; bare names always inherit the active NAMESPACE, matching Avro's rule.

What the visitor does NOT produce: the references list. The DDL grammar has no syntax for SR-side coordinates (subject + version) because those are deployment metadata that vary across environments and shouldn't be embedded in schema source. So the produced LT has an empty references list. The caller is responsible for attaching references (and the corresponding resolvedReferences content) before SR registration. USING TYPE populates schema-text shape (which $ref/import string to emit); it does not bridge to SR resolution.