commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Keese <bi...@tech.beacon-it.co.jp>
Subject [digester] how to use digester with a class hierarchy
Date Wed, 19 May 2004 02:26:24 GMT
I'm curious how people use digester to persist class hierachies.
Consider the class hiearchy below (that represent graphical objects).

class Component { int x,y; }
class TextString extends Component { String text; }
class Rectangle extends Component { int width, height; }

There are two ways represent a TextString in XML:
<textString><x>10</x><y>20</y><text>Hello world</text></textString>
<Component><x>10</x><y>20</y><textString>Hello
world</textString></Component>

Which is better? I would guess that the first version is more common,
but the second version allows simple searches of all components based on
their x/y coordinates.

Can digester digest the second version?

Thanks,
Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message