Table of Contents

Class JvmSyntax

Namespace
TypedRest.CodeGeneration.Jvm.Model
Assembly
TypedRest.CodeGeneration.Jvm.dll

Syntax helpers shared by the Java and Kotlin generators.

public static class JvmSyntax
Inheritance
object
JvmSyntax

Methods

Identifier(string)

Returns name as an identifier that is legal in both languages, suffixing reserved words.

public static string Identifier(string name)

Parameters

name string

Returns

string

IsReservedWord(string)

Indicates whether word may not be used as an identifier in Java or Kotlin.

public static bool IsReservedWord(string word)

Parameters

word string

Returns

bool

Quote(string)

Returns value as a double-quoted string literal, valid in both languages.

public static string Quote(string value)

Parameters

value string

Returns

string

Quote(string, bool)

Returns value as a double-quoted string literal.

public static string Quote(string value, bool escapeDollar)

Parameters

value string

The string to quote.

escapeDollar bool

Escapes $ as $, which Kotlin requires to keep it from starting a string template and Java rejects as an unknown escape sequence.

Returns

string