commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter_F...@blm.gov
Subject Betwixt: Trouble reading Map data
Date Wed, 27 Aug 2008 19:07:13 GMT

I have a bean containing a Map<String, String> and the get/set/add methods:

    private Map<String, String> details = new TreeMap<String, String>();

    public Map<String, String> getDetails()
    {
        return details;
    }

    public void setDetails(Map<String, String> details)
    {
        this.details = details;
    }

    public void addDetail(String key, String value)
    {
        details.put(key, value);
    }

When I use betwixt to render the bean as XML the output looks fine:

    <Details>
      <entry>
        <Key>...</Key>
        <Value>...</Value>
      </entry>
    </Details>

The problem is that when the bean is reconstructed from the XML, the Map is
empty. I put a breakpoint in the addDetail() method and it isn't getting
hit, so this method isn't being called. Is this an error in the
documentation or is there something else I've missed?


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


Mime
View raw message