You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Christoph Gaffga (triplemind.com)" <cg...@triplemind.com> on 2004/11/09 12:31:13 UTC

[betwixt] Support for Maps broken in 0.6.1-dev?!?!

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


Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 11 Nov 2004, at 22:39, Christoph Gaffga ((triplemind.com)) wrote:

>> BTW i'm considering pushing for a 1.6.1 release soon.
>
> you mean 0.6.1?

Doh!

yes

> fine with me.

great

- robert


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


Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!

Posted by "Christoph Gaffga (triplemind.com)" <cg...@triplemind.com>.
> BTW i'm considering pushing for a 1.6.1 release soon.

you mean 0.6.1?
fine with me.

regards
Christoph


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


Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 9 Nov 2004, at 22:00, Christoph Gaffga wrote:

> thanks a lot,

you should probably be cursing me for breaking it in the first place :)

> Christoph

BTW i'm considering pushing for a 1.6.1 release soon. (probably once 
improved support for binary data and land enums has been added.) 
opinions anyone?

- robert


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


Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!

Posted by Christoph Gaffga <cg...@triplemind.com>.
thanks a lot, works again :)

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


Re: [betwixt] Support for Maps broken in 0.6.1-dev?!?!

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
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