BuiltInConverterValidator

class BuiltInConverterValidator(logger: KSPLogger)

Validates the converter configuration for ambiguity at compile-time.

Scope (intentionally narrow):

  • Checks the GLOBAL @KMapperConfig(converters=...) list for duplicate pairs, ORIENTATION-NORMALIZED: and are the same pair (converters are pair-keyed and orientation-independent), so flipped duplicates are caught too. Two converters in the global list for the same pair is genuinely ambiguous → ERROR.

  • Does NOT scan all MapTypeConverter subclasses in the compilation. A converter referenced ONLY via a per-field @ConvertWith/@ConvertTo/@ConvertFrom use= override is explicit and unambiguous; it must never trigger a duplicate error even when its (S,T) pair collides with a global or built-in converter.

Constructors

Link copied to clipboard
constructor(logger: KSPLogger)

Functions

Link copied to clipboard
fun validate(globalConverterEntries: List<Pair<Pair<String, String>, String>>): Boolean

Validates the global converter list from @KMapperConfig(converters=...).