commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashwath Murthy" <ashwathmur...@gmail.com>
Subject Betwixt - Suppress empty collections
Date Mon, 15 Jan 2007 09:36:33 GMT
Hi,

I read up on the Betwixt changelog that it now supports suppression of empty
collections. Am not able to obtain this functionality though. Here's a code
snippet:
public class Something {
    ArrayList persons = new ArrayList();
    ArrayList cities = new ArrayList();
    ArrayList temps = null;
    public Collection getTempCollection() {
        return temps;
    }
    public void addTemp(Person p) {
        temps.add(p);
    }
    //adders and getters for the other two
    // beanWriter configuration:
       beanWriter.setWriteEmptyElements(false);
       beanWriter.getBindingConfiguration().setValueSuppressionStrategy(
ValueSuppressionStrategy.SUPPRESS_EMPTY);


When I write out the XML with some sample data, this is what I see...
<?xml version='1.0' ?>
...............................
      <person>
        <name>p1</name>
        <number>1</number>
      </person>
    </personCollection>
    <tempCollection/>
  </Something>


Can someone please help explain why I still see the <tempCollection/> tag??

Cheers!!

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