Table of Contents

Class KotlinWriter

Namespace
TypedRest.CodeGeneration.Kotlin
Assembly
TypedRest.CodeGeneration.Kotlin.dll

Renders the shared JVM type model as Kotlin source code.

public sealed class KotlinWriter
Inheritance
object
KotlinWriter

Constructors

KotlinWriter(JvmSerializer, bool)

Renders the shared JVM type model as Kotlin source code.

public KotlinWriter(JvmSerializer serializer, bool entryConstructor = true)

Parameters

serializer JvmSerializer

Supplies the annotations carrying wire names on generated DTOs.

entryConstructor bool

Controls whether the entry endpoint gets a generated constructor.

Fields

FileExtension

The file extension of Kotlin source files.

public const string FileExtension = ".kt"

Field Value

string

Methods

Expression(JvmExpression)

Writes an expression.

public string Expression(JvmExpression expression)

Parameters

expression JvmExpression

Returns

string

TypeExpression(JvmIdentifier)

Writes a type reference, e.g. List<Contact>?.

public string TypeExpression(JvmIdentifier identifier)

Parameters

identifier JvmIdentifier

Returns

string

WriteFile(TextWriter, IJvmType)

Writes a file declaring type.

public void WriteFile(TextWriter textWriter, IJvmType type)

Parameters

textWriter TextWriter
type IJvmType