Java SAX Parsing

前端 未结 5 1196
走了就别回头了
走了就别回头了 2020-12-06 05:25

There\'s an XML stream which I need to parse. Since I only need to do it once and build my java objects, SAX looks like the natural choice. I\'m extending DefaultHandler and

5条回答
  •  没有蜡笔的小新
    2020-12-06 06:06

    I strongly recommend to stop parsing yourself, and grab good XML data-binding library. XStream (http://x-stream.github.io/) is may personal favorite, but there many different libraries. It may be even able to parse your POJOs on the spot, without any configuration required (if you use property names and pluralisation to match the XML structure).

提交回复
热议问题