abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Couturier, Nicolas" <nicolas.coutur...@finn.no>
Subject [abdera-extensions-serializer:1.2-SNAPSHOT] @Extension annotated List<>
Date Wed, 16 Oct 2013 08:53:08 GMT
Hello,

I am giving a try at abdera-extensions-serializer:1.2-SNAPSHOT so as to
map data contained within some Java objects into some atom XML. It is a
very useful feature and I am grateful to the abdera team for it.

Recently, I tried serializing List-s of object to be serialized as atom
extensions. However, it seems that annotating my List accessor with
@Extension doesn't give me the expected result. Here is an annotated class
with the expected result as JavaDoc header:

    /**
     * <?xml version='1.0'?>
     * <entry xmlns="http://www.w3.org/2005/Atom">
     *   <foo:ext xmlns:s="http://example.org/foo">
     *     foo
     *   </foo:ext>
     *   <foo:ext xmlns:s="http://example.org/foo">
     *     bar
     *   </foo:ext>
     *   <foo:ext xmlns:s="http://example.org/foo">
     *     baz
     *   </foo:ext>
     * </entry>
     */
    @Entry
    public static final class EntryWithListOfSimpleExtensions {
        @Extension(prefix=PREFIX, ns=NS, name=EXT_NAME, simple=true)
        public List<String> getSimpleExtensions() {
            return Arrays.asList("foo", "bar", "baz");
        }
    }


Here is the output I actually get:

    <?xml version='1.0' encoding='UTF-8'?>
    <entry xmlns="http://www.w3.org/2005/Atom">
      <foo:ext xmlns:foo="http://example.org/foo">foo, bar, baz</foo:ext>
    </entry>


Would any of you guys know how the achieve this? (another annotation to
use?)

Thanks in advance.

Best regards,
Nicolas Couturier


Mime
View raw message