Package com. squareup. moshi. kotlin. codegen. api
Types
Adapter Generator
Link copied to clipboard
class AdapterGenerator(target: TargetType, propertyList: List<PropertyGenerator>)
Content copied to clipboard
Generates a JSON adapter for a target type.
Delegate Key
Link copied to clipboard
data class DelegateKey(type: TypeName, jsonQualifiers: List<AnnotationSpec>)
Content copied to clipboard
A JsonAdapter that can be used to encode and decode a particular field.
Internal Moshi Codegen Api
Link copied to clipboard
annotation class InternalMoshiCodegenApi
Content copied to clipboard
Internal Moshi code gen APIs.
Options
Link copied to clipboard
Prepared Adapter
Link copied to clipboard
data class PreparedAdapter(spec: FileSpec, proguardConfig: ProguardConfig?)
Content copied to clipboard
Represents a prepared adapter with its spec and optional associated proguardConfig.
Proguard Config
Link copied to clipboard
Property Generator
Link copied to clipboard
class PropertyGenerator(target: TargetProperty, delegateKey: DelegateKey, isTransient: Boolean)
Content copied to clipboard
Generates functions to encode and decode a property as JSON.
Qualifier Adapter Property
Link copied to clipboard
data class QualifierAdapterProperty(name: String, qualifiers: Set<ClassName>)
Content copied to clipboard
Represents a qualified property with its name in the adapter fields and list of qualifiers associated with it.
Target Constructor
Link copied to clipboard
data class TargetConstructor(parameters: LinkedHashMap<String, TargetParameter>, visibility: KModifier, signature: String?)
Content copied to clipboard
A constructor in user code that should be called by generated code.
Target Parameter
Link copied to clipboard
Target Property
Link copied to clipboard
data class TargetProperty(propertySpec: PropertySpec, parameter: TargetParameter?, visibility: KModifier, jsonName: String?, jsonIgnore: Boolean)
Content copied to clipboard
A property in user code that maps to JSON.
Target Type
Link copied to clipboard
data class TargetType(typeName: TypeName, constructor: TargetConstructor, properties: Map<String, TargetProperty>, typeVariables: List<TypeVariableName>, isDataClass: Boolean, visibility: KModifier)
Content copied to clipboard
A user type that should be decoded and encoded by generated code.