FormSchemaBuilder

abstract class FormSchemaBuilder

Abstrakcyjna fabryka do tworzenia schematów formularzy.

Każdy formularz powinien mieć własną implementację buildera, która definiuje specyficzną strukturę kontrolek, ich kolejność i konfiguracje dla danej domeny biznesowej.

Przykładowa implementacja:

class UserFormSchemaBuilder : FormSchemaBuilder() {
override fun build(): FormSchema {
return FormSchema(
controls = mapOf(
"name" to StringControl(label = "Imię", required = true),
"email" to StringControl(label = "Email")
),
contentOrder = listOf("name", "email"),
actionBarOrder = listOf("save", "cancel")
)
}
}

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun defineContentOrder(): List<String>
Link copied to clipboard
abstract fun defineControls(): Map<String, Control<*>>