Hi all,
given an XML with something like
<REPORT>
<XTABLE name="Table1" x="1200" y="2250">
<rows>10</rows>
</XTABLE>
<VTABLE name="Table2" x="1400" y="2250">
<rows>14</rows>
</VTABLE>
<HTABLE name="Table3" x="1600" y="2250">
<rows>17</rows>
</HTABLE>
</REPORT>
I would like to map all nodes (XTABLE, VTABLE and HTABLE) to one class Table
and set the properties.
While learning digester I created a class for each tag, but now I want to
improve that.
For the class itself the following should work
@ObjectCreate.List(value = {
@ObjectCreate(pattern = "*/HTABLE"),
@ObjectCreate(pattern = "*/VTABLE"),
@ObjectCreate(pattern = "*/XTABLE")
})
public class Table {
private String name;
private Long posX;
private Long posY;
private Long rows;
}
But how should I annotate the properties as I have to set the pattern attribute
to all @SetProperty annotations and the pattern is different for all of them.
Any help appreciated.
Jan