Re: [Simple-support] @ElementList on List interface adds class attribute to XML
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2007-12-06 19:17:20
|
Hi,
There are several ways to do this. One is to use the
inline=true attribute in @ElementList. This will
select an ArrayList from the Java collections
framework. For example
@ElementList(inline=true)
private List<String> list;
Or you can implement a Strategy, which is used to
resolve and instantiate all classes. Take a look at
DefaultStrategy.
Niall
--- Ealden Escañan <ea...@gm...> wrote:
> Hi, all
>
> I'm trying to convert a List<String> into XML. I
> used @ElementList as
> mentioned in the tutorial which works but the
> attribute "class" is
> added to my XML:
>
> @Root
> public class Table {
> @ElementList
> private List<String> list;
>
> ....
> }
>
> <table>
> <list class="java.util.ArrayList">
> ...
> </list>
> </table>
>
> XML conversion works correctly if I used a concrete
> implementation
> such as an ArrayList. Is there a way to still make
> use of List
> without Simple adding the "class" attribute?
>
> Thanks
>
> --
> Ealden Esto E. Escañan
> http://ealden.net
>
>
-------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux
> Business White Paper
> from Novell. From the desktop to the data center,
> Linux is going
> mainstream. Let it simplify your IT future.
>
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
>
https://lists.sourceforge.net/lists/listinfo/simple-support
>
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
|