Package-level declarations

Types

Link copied to clipboard
data class CollectionWrapperDescriptor(val wrapperObjectFqn: String, val forTypeFqn: String, val providesWrap: Boolean, val providesUnwrap: Boolean)

A validated @CollectionWrapper registration: which container type it serves and which directions it provides. TypeMatcher consults the direction flags so a mapping that needs a missing direction gets a guided compile error (the wrapper counterpart of UnsupportedConversion).

Link copied to clipboard
class CollectionWrapperValidator(logger: KSPLogger)

Validates a @CollectionWrapper object's duck-typed contract against its forType. Kotlin has no higher-kinded types, so the shapes are conventions — compile-checked here:

Link copied to clipboard
class ConverterIntrospector(resolver: Resolver, logger: KSPLogger? = null)

Reads a converter declaration's ConverterShape from the KSP Resolver: its (S, T) type pair from the MapTypeConverter supertype — found by walking UP the superclass chain, so parameterized-converter bases (the ledger's official recipe: object PriceFormatConverter : FormattedDoubleStringConverter(digits = 2) where the abstract base extends MapTypeConverter<Double, String>) resolve too — and which directions it provides, via function-level detection of the declared overrides (most derived wins) and their @UnsupportedDirection annotations.

Link copied to clipboard
data class ConverterShape(val sourceFqn: String, val targetFqn: String, val declaredToTotal: Boolean, val declaredToOrNull: Boolean, val declaredFromTotal: Boolean, val declaredFromOrNull: Boolean, val unsupportedToReason: String?, val unsupportedFromReason: String?, val orNullAnnotatedFunction: String?)

Which directions a converter provides, and any declared @UnsupportedDirection reasons.

Link copied to clipboard
class CycleDetector(logger: KSPLogger)

Detects guaranteed-infinite mapping cycles at compile time.

Link copied to clipboard
class FieldAnalyzer(logger: KSPLogger)

Analyzes fields (constructor parameters) and extracts mapping annotations.

Link copied to clipboard
class TypeMatcher(logger: KSPLogger, customConverters: Map<Pair<String, String>, String> = emptyMap(), collectionWrappers: Map<String, CollectionWrapperDescriptor> = emptyMap(), introspector: ConverterIntrospector? = null)

Determines the appropriate mapping strategy for field transformations.

Functions

Link copied to clipboard
fun discoverWrappersFromConfig(resolver: Resolver, logger: KSPLogger): Map<String, CollectionWrapperDescriptor>

Reads all @KMapperConfig.wrappers listings (in-module, works on KMP/iOS), resolves each wrapper object's @CollectionWrapper.forType, and validates the duck-typed wrap/unwrap contract via CollectionWrapperValidator to build Map.