Remove class= attribute

后端 未结 1 1955
忘了有多久
忘了有多久 2020-12-01 06:22

I\'m using simple xml library: http://simple.sourceforge.net/home.php

I have a problem with @ElementList annotation: if I use this annotation like this:



        
相关标签:
1条回答
  • 2020-12-01 07:21

    The class Attribute tells Simple which implementation of List you use. If it's missing, Simple will look for a proper class itself.

    One solution is to use ArrayList instead of List:

    @ElementList
    protected ArrayList<Element> elements;
    

    Now Simple wont add the class-Attribute.

    Another way:

    @Path("elements")
    @ElementList(inline=true)
    protected List<Element> elements;
    

    This inlines your List (no elements-Tag is used) but puts it into a "new" elements-Tag

    0 讨论(0)
提交回复
热议问题