abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Annotations
Date Mon, 30 Jul 2007 20:51:15 GMT
I've been thinking lately about the possibility of defining a set of
Java 5 annotations that would allow developers to mark up their beans in
a way that allows serialization into Atom elements.  For instance,

  public static class Foo {

    public String getId() {
      return "http://example.org/foo";

    public String getTitle() {
      return "Foo";

    public String getAltLink() {
      return "http://example.org";

    public String getOtherLink() {
      return "http://example.com/foo.jpg";

    public String getContent() {
      return "Bar";

The trick to making this successful would be to make sure the
annotations are expressive enough to capture the broad range of options
in Atom while not making it too complex.  A special converter would be
provided that would take an object instance annotated in this way and
return the appropriate Atom object, e.g.

  Foo foo = new Foo();
  Entry entry = Converter.convert(foo, abdera);

The main question I have is whether or not this would be useful enough
to go through the trouble of implementing it.  Thoughts?

- James

View raw message