tomj74 / chunk-templates

Chunk Templates, a template engine for Java
http://www.x5software.com/chunk/
MIT License
77 stars 10 forks source link

in android ,property case different is not working #38

Closed yang0000meng closed 2 years ago

yang0000meng commented 3 years ago

template

{% loop in $tvlist as $list %}
{$list.listname} <br>
{$list.ListName}<br>
{$list}<br>
{% endloop %}

the not working class

@AccessAsBean
@AccessAsPojo
public class Info {

    private String ListName;
    public  String getListName()
    {
        return ListName;
    }
    public  void setListName(String value)
    {
        ListName = value;
    }
}

the working class

public class Info {

    private String ListName;
    public  String getListname()
    {
        return ListName;
    }
    public  void setListname(String value)
    {
        ListName = value;
    }
}

the different is getListname() and getListName()

when has two upper letters is not working

tomj74 commented 2 years ago

CamelCase is converted to snake_case so the field is probably exposed as list_name with an underscore, not listName

will test and confirm