summaryrefslogtreecommitdiff
path: root/ddl/templates/data.java.ede
blob: 71e3bd2a92decfa1a85108b62e9d5ddd5aa1bc4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// generated file, do not modify!
// {{ dateTime }}

package {{ moduleName }};

import java.util.ArrayList;
import java.util.HashMap;
import RT.*;

{% for m in imports %}
import {{ m.value }}.*;
{% endfor %}

{% case def | constType %}
{% when "DataDef" %}
public class {{ def.dataName }} {
  public enum Tag { {% for c in def.constructors %}
    {{ c.value.name }}{% if !c.last %},{% endif %}{% endfor %}
  }
  public Tag tag;
{% for c in def.constructors %}{% if !(c.value.fields | empty) %}
  public class {{ c.value.name }}_ extends {{ def.dataName }} { {% for f in c.value.fields %}{% if c.value.fields | hasFieldNames %}
    public {{ f.value.fieldType | javaType }} {{ f.value.fieldName }};{% else %}
    public {{ f.value.fieldType | javaType }} _{{ f.index0 }};{% endif %}{% endfor %}
    public {{ c.value.name }}_() { tag = {{ def.dataName }}.Tag.{{ c.value.name }}; }
  }{% endif %}{% endfor %}
}

{% endcase %}