summaryrefslogtreecommitdiff
path: root/generator/templates/struct_function_template.java
blob: 9eea20285cef7217e9e5de40d6307f6d39668ec4 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{%extends"base_template.java"%}

        {%block body%}
public class {{class_name}}extends{{extends_class}}{
        {%-block params%}
        {%-endblock%}

        /**
         * Constructs a new {{class_name}} object
         */
        {%-block constructor_simple%}
        {%endblock%}

/**
 * Constructs a new {{class_name}} object indicated by the Hashtable parameter
 *
 * @param hash The Hashtable to use
 */
public {{class_name}}(Hashtable<String, Object> hash){
        super(hash);
        }
        {%-if params is defined%}
        {%-set constructor=[]%}
        {%-for p in params|selectattr('mandatory')%}{{constructor.append('@NonNull '+p.return_type+' '+p.last)or''}}
        {%-endfor%}
        {%-if constructor|length>0%}

/**
 * Constructs a new {{class_name}} object
 *
 {%- for p in params|selectattr('mandatory') %}
 {%- include "javadoc_template.java" %}
 {%- endfor %}
 */
public {{class_name}}({{constructor|join(', ')}}){
        this();
        {%-for p in params|selectattr('mandatory')%}
        set{{p.title}}({{p.last}});
        {%-endfor%}
        }
        {%-endif%}
        {%-endif%}

        {%-if params is defined%}
        {%-block setter%}
        {%-endblock%}
        {%-endif%}
        }
        {%endblock-%}