Package com. squareup. moshi. kotlin. codegen. api
Types
Link copied to clipboard
class AdapterGenerator(target: TargetType, propertyList: List<PropertyGenerator>)
Content copied to clipboard
Generates a JSON adapter for a target type.
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.
Link copied to clipboard
Internal Moshi code gen APIs.
Link copied to clipboard
Link copied to clipboard
data class PreparedAdapter(val spec: FileSpec, val proguardConfig: ProguardConfig?)
Content copied to clipboard
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>)
Content copied to clipboard
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)
Content copied to clipboard
Generates functions to encode and decode a property as JSON.
Link copied to clipboard
data class QualifierAdapterProperty(val name: String, val 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.
Link copied to clipboard
data class TargetConstructor( val parameters: LinkedHashMap<String, TargetParameter>, val visibility: KModifier, val signature: String?)
Content copied to clipboard
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)
Content copied to clipboard
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)
Content copied to clipboard
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)
Content copied to clipboard
A user type that should be decoded and encoded by generated code.