How to parse XML to Java object with Digester -
i using apache digester parse xml object. have following xml element:
<a type="x" xname = "...">..<a> <a type="t" tname = "...">..<a> i have class
public class x{ private string xname; public static class t{ private string tname; } } is able if type x create class x, if type t create class t, notice t public inner , child class of x. if yes, how define rule. using digester 2.x, or introduce better design
first off, why xml? json way go. check out google's gson lib serializing java objects. great library. otherwise, here's digester tutorial: http://www.javacodegeeks.com/2012/09/apache-digester-example-make-easy.html
Comments
Post a Comment