File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 22
33- [ node] ( #node ) - hassle-free ` npm install ` and ` npm run blah `
44- [ static server] ( #static-server ) - a simple static file server
5+ - [ jte] ( #jte ) - creates idiomatic Kotlin model classes for ` jte ` templates (strict nullability & idiomatic collections and generics)
56
67## Node
78
@@ -30,3 +31,38 @@ tasks.register('serve', com.diffplug.webtools.serve.StaticServerTask) {
3031 port = 8080 // by default
3132}
3233```
34+
35+ ### JTE
36+
37+ You have to apply ` gg.jte.gradle ` plugin yourself. We add a task called ` jteModels ` which creates a Kotlin model classes with strict nullability. Like so:
38+
39+ ``` jte
40+ // header.jte
41+ @param String title
42+ @param String createdAtAndBy
43+ @param Long idToImpersonateNullable
44+ @param String loginLinkNullable
45+ ```
46+
47+ will turn into
48+
49+ ``` kotlin
50+ class header (
51+ val title : String ,
52+ val createdAtAndBy : String ,
53+ val idToImpersonateNullable : Long? ,
54+ val loginLinkNullable : String? ,
55+ ) : common.JteModel {
56+
57+ override fun render (engine : TemplateEngine , output : TemplateOutput ) {
58+ engine.render(" pages/Admin/userShow/header.jte" , mapOf (
59+ " title" to title,
60+ " createdAtAndBy" to createdAtAndBy,
61+ " idToImpersonateNullable" to idToImpersonateNullable,
62+ " loginLinkNullable" to loginLinkNullable,
63+ ), output)
64+ }
65+ }
66+ ```
67+
68+ We also translate Java collections and generics to their Kotlin equivalents. See ` JteRenderer.convertJavaToKotlin ` for details.
You can’t perform that action at this time.
0 commit comments