commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Fröhlich <>
Subject [digester] Multiple paths mapped to one object
Date Wed, 05 Mar 2014 10:55:29 GMT
Hi all,

given an XML with something like
    <XTABLE name="Table1" x="1200" y="2250">
    <VTABLE name="Table2" x="1400" y="2250">
    <HTABLE name="Table3" x="1600" y="2250">

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.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message