commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!
Date Tue, 09 Nov 2004 16:19:37 GMT
hi christoph

my bad :(

(refactored some stuff to deprecate XMLIntrospectorHelper but the test 
cases missed this scenario)

if you try again from CVS HEAD, it should be fixed now (and has a unit 
test :)

- robert

On 9 Nov 2004, at 11:31, Christoph Gaffga ((triplemind.com)) wrote:

> hi,
>
> I have some trouble with the latest version of betwixt. It seems to me 
> that
> the support for Maps is broken.
>
> I tested with the following example:
>
>   Map hash = new Hashtable();
>   hash.put("de", "deutsch");
>   hash.put("en", "english");
>   hash.put("es", "espaniol");
>   beanWriter = new BeanWriter(System.out);
>   beanWriter.enablePrettyPrint();
>   beanWriter.setWriteEmptyElements(false);
>   beanWriter.getBindingConfiguration().setMapIDs(false);
>   beanWriter.setXMLIntrospector(new XMLIntrospector());
>   beanWriter.write(hash);
>
> and get the follwoing result:
>
>   <Hashtable>
>     <empty>false</empty>
>   </Hashtable>
>
> when removing the setWriteEmptyElements(false) line, I get:
>
>   <Hashtable>
>     <empty>false</empty>
>     <entry>
>       <key>en</key>
>       <value>english</value>
>     </entry>
>     <entry>
>       <key>es</key>
>       <value>espaniol</value>
>     </entry>
>     <entry>
>       <key>de</key>
>       <value>deutsch</value>
>     </entry>
>   </Hashtable>
>
> So there seem to be a problem with supressing empty elements. And I 
> wondered
> why the empty-Property is written, should be suppressed.
>
> Any help would be appreciated.
>
> regards
> Christoph Gaffga
> cgaffga@triplemind.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
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