JAXB unmarshalling of “generic” real world documents

后端 未结 2 1247
死守一世寂寞
死守一世寂寞 2021-01-23 06:37

We have a large set of configuration documents of the style


  
    ...more content
  
  

        
2条回答
  •  隐瞒了意图╮
    2021-01-23 07:30

    If the structure really is that simple I'd be tempted to parse the top two levels (foo and the class attribute of bar) myself using an XMLStreamReader, then hand the reader off to the JAXB unmarshaller to parse each bar, assembling the results into a list. I wouldn't bother trying to parse the outer envelope layers using JAXB directly.

提交回复
热议问题