Package com.squareup.moshi.kotlin.codegen.api

Types

Link copied to clipboard
class AdapterGenerator(target: TargetType, propertyList: List<PropertyGenerator>)

Generates a JSON adapter for a target type.

Link copied to clipboard
data class DelegateKey(type: TypeName, jsonQualifiers: List<AnnotationSpec>)

A JsonAdapter that can be used to encode and decode a particular field.

Link copied to clipboard
annotation class InternalMoshiCodegenApi

Internal Moshi code gen APIs.

Link copied to clipboard
object Options
Link copied to clipboard
data class PreparedAdapter(val spec: FileSpec, val proguardConfig: ProguardConfig?)

Represents a prepared adapter with its spec and optional associated proguardConfig.

Link copied to clipboard
data class ProguardConfig(    val targetClass: ClassName,     val adapterName: String,     val adapterConstructorParams: List<String>,     val targetConstructorHasDefaults: Boolean,     val targetConstructorParams: List<String>)

Represents a proguard configuration for a given spec. This covers three main areas:

Link copied to clipboard
class PropertyGenerator(    val target: TargetProperty,     val delegateKey: DelegateKey,     val isTransient: Boolean = false)

Generates functions to encode and decode a property as JSON.

Link copied to clipboard
data class QualifierAdapterProperty(val name: String, val qualifiers: Set<ClassName>)

Represents a qualified property with its name in the adapter fields and list of qualifiers associated with it.

Link copied to clipboard
data class TargetConstructor(    val parameters: LinkedHashMap<String, TargetParameter>,     val visibility: KModifier,     val signature: String?)

A constructor in user code that should be called by generated code.

Link copied to clipboard
data class TargetParameter(    val name: String,     val index: Int,     val type: TypeName,     val hasDefault: Boolean,     val jsonName: String? = null,     val jsonIgnore: Boolean = false,     val qualifiers: Set<AnnotationSpec>? = null)

A parameter in user code that should be populated by generated code.

Link copied to clipboard
data class TargetProperty(    val propertySpec: PropertySpec,     val parameter: TargetParameter?,     val visibility: KModifier,     val jsonName: String?,     val jsonIgnore: Boolean)

A property in user code that maps to JSON.

Link copied to clipboard
data class TargetType(    val typeName: TypeName,     val constructor: TargetConstructor,     val properties: Map<String, TargetProperty>,     val typeVariables: List<TypeVariableName>,     val isDataClass: Boolean,     val visibility: KModifier)

A user type that should be decoded and encoded by generated code.