summaryrefslogtreecommitdiff
path: root/ddl/templates/data.java.ede
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/templates/data.java.ede')
-rw-r--r--ddl/templates/data.java.ede33
1 files changed, 17 insertions, 16 deletions
diff --git a/ddl/templates/data.java.ede b/ddl/templates/data.java.ede
index c85a521..2aec628 100644
--- a/ddl/templates/data.java.ede
+++ b/ddl/templates/data.java.ede
@@ -1,26 +1,27 @@
1// generated file, do not modify! 1// generated file, do not modify!
2// {{ dateTime }} 2// {{ dateTime }}
3 3
4package {{ moduleName }};
5
6import java.util.ArrayList;
7import java.util.HashMap;
8
4{% for m in imports %} 9{% for m in imports %}
5import {{ m.value }}; 10import {{ m.value }}.*;
6{% endfor %} 11{% endfor %}
7 12
8public class {{ moduleName }} { 13{% case def | constType %}
9{% for t in dataAndType %}
10{% case t.value | constType %}
11{% when "DataDef" %} 14{% when "DataDef" %}
12 public class {{ t.value.dataName }} { 15public class {{ def.dataName }} {
13 public enum Tag { {% for c in t.value.constructors %} 16 public enum Tag { {% for c in def.constructors %}
14 {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %} 17 {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %}
15 }
16 public Tag tag;
17{% for c in t.value.constructors %}{% if !(c.value.fields | empty) %}
18 public class {{ c.value.name }}_ extends {{ t.value.dataName }} { {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %}
19 public {{ f.value.fieldType | javaType }} {{ f.value.fieldName }};{% else %}
20 public {{ f.value.fieldType | javaType }} _{{ f.index0 }};{% endif %}{% endfor %}
21 }{% endif %}{% endfor %}
22 } 18 }
19 public Tag tag;
20{% for c in def.constructors %}{% if !(c.value.fields | empty) %}
21 public class {{ c.value.name }}_ extends {{ def.dataName }} { {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %}
22 public {{ f.value.fieldType | javaType }} {{ f.value.fieldName }};{% else %}
23 public {{ f.value.fieldType | javaType }} _{{ f.index0 }};{% endif %}{% endfor %}
24 }{% endif %}{% endfor %}
25}
23 26
24{% endcase %} 27{% endcase %}
25{% endfor %}
26} \ No newline at end of file