Re: [Simple-support] obligation of "static public class" ?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2009-04-21 12:00:26
|
Hi,
So what exception are you getting?
Niall
--- On Tue, 4/21/09, Patrice Bertrand <pat...@sm...> wrote:
> From: Patrice Bertrand <pat...@sm...>
> Subject: [Simple-support] obligation of "static public class" ?
> To: sim...@li...
> Date: Tuesday, April 21, 2009, 1:22 AM
> Hello,
> I see some persons mention a similar problem: an
> exception occuring
> when reading a list of elements. And I
> read Niall answering "you must
> declare a 'static public class' for the embedded
> items. So I changed
> my code to have both outer and inner classes in same file,
> with inner
> class declared as static public class within the first
> class, like this:
>
> @Root
> public class PropertyList {
>
> @ElementList
> private List<Entry> list;
>
> @Attribute
> private String name;
>
> public String getName() {
> return name;
> }
>
> public List getProperties() {
> return list;
> }
>
> @Root
> public static class Entry {
>
> @Attribute
> private String key;
>
> @Element
> private String value;
>
> public String getName() {
> return name;
> }
>
> public String getValue() {
> return value;
> }
> }
>
> }
>
>
> (I take this from the tutorial page, but with a minor
> change to embed
> "Entry" into "PropertyList" and make it static.)
>
> However, I still get the same exception when
> reading. What is exactly
> this obligation of a "public static class" and is it
> possible to find
> the rules that apply. The tutorial is VERY
> well done, for giving a
> overview of the possibilities, but is it possible that the
> sample code
> that are in the tutorial would not work ?
>
> Sorry for this beginner's question. I did
> go through the archive
> trying to find the answer (although search function seems
> to be
> unavailable).
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside
> and
> around Java (TM) technology - register by April 22, and
> save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San
> Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|