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
-
objectKotlinWriter
Constructors
KotlinWriter(JvmSerializer, bool)
Renders the shared JVM type model as Kotlin source code.
public KotlinWriter(JvmSerializer serializer, bool entryConstructor = true)
Parameters
serializerJvmSerializerSupplies the annotations carrying wire names on generated DTOs.
entryConstructorboolControls whether the entry endpoint gets a generated constructor.
Fields
FileExtension
The file extension of Kotlin source files.
public const string FileExtension = ".kt"
Field Value
Methods
Expression(JvmExpression)
Writes an expression.
public string Expression(JvmExpression expression)
Parameters
expressionJvmExpression
Returns
TypeExpression(JvmIdentifier)
Writes a type reference, e.g. List<Contact>?.
public string TypeExpression(JvmIdentifier identifier)
Parameters
identifierJvmIdentifier
Returns
WriteFile(TextWriter, IJvmType)
Writes a file declaring type.
public void WriteFile(TextWriter textWriter, IJvmType type)
Parameters
textWriterTextWritertypeIJvmType