JAXB endless data structure, recursive binding?

前端 未结 1 1007
遥遥无期
遥遥无期 2021-01-14 12:42

sBefore starting a project I wanted to get a short heads up here.

If I have a structure like this:



    
        <         


        
相关标签:
1条回答
  • 2021-01-14 13:35

    Yes you can have the following:

    @XmlAccessorType(XmlAccessType.FIELD)
    public class A {
    
        private List<A> a;
    
    }
    

    And your JAXB (JSR-222) implementation will marshal it correctly.

    Related Example

    • How to unmarshal xml message with bad parent/child model
    0 讨论(0)
提交回复
热议问题