abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1187146 - in /abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities: extra/ model/ model/objects/
Date Fri, 21 Oct 2011 01:01:51 GMT
Author: jmsnell
Date: Fri Oct 21 01:01:50 2011
New Revision: 1187146

URL: http://svn.apache.org/viewvc?rev=1187146&view=rev
Log:
Factory/builder support

Modified:
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BinaryObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BookObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/CreativeWork.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ExtendedEventObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/MovieObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/OfferObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvEpisodeObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeasonObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeriesObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/VersionObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java
    abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BinaryObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BinaryObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BinaryObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BinaryObject.java Fri Oct 21 01:01:50 2011
@@ -163,5 +163,51 @@ public class BinaryObject extends FileOb
   public void setData(byte[] data, int s, int e, Hasher hash, CompressionCodec... comps) throws IOException {
     setData(new ByteArrayInputStream(data,s,e),hash,comps);
   }
+ 
+  public static <T extends BinaryObject>BinaryObjectGenerator<T> makeBinary() {
+    return new BinaryObjectGenerator<T>();
+  }
   
+  @SuppressWarnings("unchecked")
+  public static class BinaryObjectGenerator<T extends BinaryObject> extends FileObjectGenerator<T> {
+    public BinaryObjectGenerator() {
+      super((Class<T>) BinaryObject.class);
+    }
+    public BinaryObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(InputStream in) throws IOException {
+      item.setData(in);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(InputStream in, Hasher hasher, CompressionCodec... codecs) throws IOException {
+      item.setData(in,hasher,codecs);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(DataHandler in, CompressionCodec... codecs) throws IOException {
+      item.setData(in,codecs);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(DataHandler in, Hasher hasher, CompressionCodec... codecs) throws IOException {
+      item.setData(in,hasher,codecs);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(byte[] in, CompressionCodec... codecs) throws IOException {
+      item.setData(in,codecs);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(byte[] in, Hasher hasher, CompressionCodec... codecs) throws IOException {
+      item.setData(in,hasher,codecs);
+      return (X)this;
+    }
+    
+    public <X extends BinaryObjectGenerator<T>>X data(byte[] in, int s, int e, CompressionCodec... codecs) throws IOException {
+      item.setData(in,s,e,codecs);
+      return (X)this;
+    }
+    public <X extends BinaryObjectGenerator<T>>X data(byte[] in, int s, int e, Hasher hasher, CompressionCodec... codecs) throws IOException {
+      item.setData(in,s,e,hasher,codecs);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BookObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BookObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BookObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/BookObject.java Fri Oct 21 01:01:50 2011
@@ -59,5 +59,38 @@ public class BookObject extends Creative
   public void setIllustrator(ASObject illustrator) {
     setProperty("illustrator", illustrator);
   }
+ 
+  public static <T extends BookObject>BookObjectGenerator<T> makeBook() {
+    return new BookObjectGenerator<T>();
+  }
   
+  @SuppressWarnings("unchecked")
+  public static class BookObjectGenerator<T extends BookObject> extends CreativeWorkGenerator<T> {
+    public BookObjectGenerator() {
+      super((Class<T>) BookObject.class);
+    }
+    public BookObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends BookObjectGenerator<T>>X edition(String val) {
+      item.setEdition(val);
+      return (X)this;
+    }
+    public <X extends BookObjectGenerator<T>>X format(ASObject obj) {
+      item.setFormat(obj);
+      return (X)this;
+    }
+    public <X extends BookObjectGenerator<T>>X illustrator(ASObject obj) {
+      item.setIllustrator(obj);
+      return (X)this;
+    }
+    public <X extends BookObjectGenerator<T>>X isbn(String val) {
+      item.setIsbn(val);
+      return (X)this;
+    }
+    public <X extends BookObjectGenerator<T>>X pageCount(int count) {
+      item.setPageCount(count);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/CreativeWork.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/CreativeWork.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/CreativeWork.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/CreativeWork.java Fri Oct 21 01:01:50 2011
@@ -63,5 +63,34 @@ public abstract class CreativeWork exten
   public void setEditor(ASObject editor) {
     setProperty("editor", editor);
   }
- 
+  
+  public static abstract class CreativeWorkGenerator<T extends CreativeWork> extends ASObjectGenerator<T> {
+    protected CreativeWorkGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends CreativeWorkGenerator<T>>X about(ASObject object) {
+      item.setAbout(object);
+      return (X)this;
+    }
+    public <X extends CreativeWorkGenerator<T>>X contributor(ASObject object) {
+      item.setContributor(object);
+      return (X)this;
+    }
+    public <X extends CreativeWorkGenerator<T>>X editor(ASObject object) {
+      item.setEditor(object);
+      return (X)this;
+    }
+    public <X extends CreativeWorkGenerator<T>>X genre(ASObject object) {
+      item.setGenre(object);
+      return (X)this;
+    }
+    public <X extends CreativeWorkGenerator<T>>X provider(ASObject object) {
+      item.setProvider(object);
+      return (X)this;
+    }
+    public <X extends CreativeWorkGenerator<T>>X publisher(ASObject object) {
+      item.setPublisher(object);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ExtendedEventObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ExtendedEventObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ExtendedEventObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/ExtendedEventObject.java Fri Oct 21 01:01:50 2011
@@ -54,4 +54,36 @@ public abstract class ExtendedEventObjec
     setProperty("performers", performers);
   }
   
+  public static <T extends ExtendedEventObject>ExtendedEventObjectGenerator<T> makeExtendedEvent() {
+    return new ExtendedEventObjectGenerator<T>();
+  }
+  
+  public static class ExtendedEventObjectGenerator<T extends ExtendedEventObject> extends EventObjectGenerator<T> {
+    public ExtendedEventObjectGenerator() {
+      super((Class<? extends T>) ExtendedEventObject.class);
+    }
+    public ExtendedEventObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends ExtendedEventObjectGenerator<T>>X host(ASObject object) {
+      item.setHost(object);
+      return (X)this;
+    }
+    public <X extends ExtendedEventObjectGenerator<T>>X offers(ASObject object) {
+      item.setOffers(object);
+      return (X)this;
+    }
+    public <X extends ExtendedEventObjectGenerator<T>>X performers(ASObject object) {
+      item.setPerformers(object);
+      return (X)this;
+    }
+    public <X extends ExtendedEventObjectGenerator<T>>X subEvents(ASObject object) {
+      item.setSubEvents(object);
+      return (X)this;
+    }
+    public <X extends ExtendedEventObjectGenerator<T>>X superEvent(ASObject object) {
+      item.setSuperEvent(object);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/MovieObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/MovieObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/MovieObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/MovieObject.java Fri Oct 21 01:01:50 2011
@@ -82,4 +82,45 @@ public class MovieObject extends Creativ
   public void setPreview(MediaLink link) {
     setProperty("preview", link);
   }
+  
+  public static <T extends MovieObject>MovieObjectGenerator<T> makeMovie() {
+    return new MovieObjectGenerator<T>();
+  }
+  
+  public static class MovieObjectGenerator<T extends MovieObject> extends CreativeWorkGenerator<T> {
+    public MovieObjectGenerator() {
+      super((Class<T>) MovieObject.class);
+    }
+    public MovieObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends MovieObjectGenerator<T>>X actors(ASObject obj) {
+      item.setActors(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X director(ASObject obj) {
+      item.setDirector(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X duration(Duration obj) {
+      item.setDuration(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X musicBy(ASObject obj) {
+      item.setMusicBy(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X preview(MediaLink obj) {
+      item.setPreview(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X producer(ASObject obj) {
+      item.setProducer(obj);
+      return (X)this;
+    }
+    public <X extends MovieObjectGenerator<T>>X productionCompany(ASObject obj) {
+      item.setProductionCompany(obj);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/OfferObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/OfferObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/OfferObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/OfferObject.java Fri Oct 21 01:01:50 2011
@@ -1,11 +1,10 @@
 package org.apache.abdera2.activities.extra;
 
-import java.util.Date;
-
 import org.apache.abdera2.activities.io.gson.Properties;
 import org.apache.abdera2.activities.io.gson.Property;
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.common.anno.Name;
+import org.joda.time.DateTime;
 
 /**
  * A simple "objectType":"offer" object that serves primarily as an 
@@ -13,8 +12,8 @@ import org.apache.abdera2.common.anno.Na
  */
 @Name("offer")
 @Properties({
-  @Property(name="validFrom",to=Date.class),
-  @Property(name="validUntil",to=Date.class)
+  @Property(name="validFrom",to=DateTime.class),
+  @Property(name="validUntil",to=DateTime.class)
 })
 @SuppressWarnings("unchecked")
 public class OfferObject extends ASObject {
@@ -67,19 +66,19 @@ public class OfferObject extends ASObjec
     setProperty("currency",currency);
   }
   
-  public Date getValidUntil() {
+  public DateTime getValidUntil() {
     return getProperty("validUntil");
   }
   
-  public void setValidUntil(Date date) {
+  public void setValidUntil(DateTime date) {
     setProperty("validUntil", date);
   }
   
-  public Date getValidFrom() {
+  public DateTime getValidFrom() {
     return getProperty("validFrom");
   }
   
-  public void setValidFrom(Date date) {
+  public void setValidFrom(DateTime date) {
     setProperty("validFrom", date);
   }
 
@@ -90,4 +89,49 @@ public class OfferObject extends ASObjec
   public void setRestriction(ASObject restriction) {
     setProperty("restriction", restriction);
   }
+  
+  public static <T extends OfferObject>OfferObjectGenerator<T> makeOffer() {
+    return new OfferObjectGenerator<T>();
+  }
+  
+  public static class OfferObjectGenerator<T extends OfferObject> extends ASObjectGenerator<T> {
+    public OfferObjectGenerator() {
+      super((Class<T>)OfferObject.class);
+    }
+    public OfferObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends OfferObjectGenerator<T>>X availability(ASObject obj) {
+      item.setAvailability(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X condition(ASObject obj) {
+      item.setCondition(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X currency(String obj) {
+      item.setCurrency(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X item(ASObject obj) {
+      item.setItem(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X price(String obj) {
+      item.setPrice(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X restriction(ASObject obj) {
+      item.setRestriction(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X validFrom(DateTime obj) {
+      item.setValidFrom(obj);
+      return (X)this;
+    }
+    public <X extends OfferObjectGenerator<T>>X validUntil(DateTime obj) {
+      item.setValidUntil(obj);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvEpisodeObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvEpisodeObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvEpisodeObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvEpisodeObject.java Fri Oct 21 01:01:50 2011
@@ -5,6 +5,7 @@ import org.apache.abdera2.activities.io.
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.activities.model.MediaLink;
 import org.apache.abdera2.common.anno.Name;
+import org.joda.time.DateTime;
 
 /**
  * A simple "objectType":"tv-episode" object that serves primarily as an 
@@ -12,7 +13,8 @@ import org.apache.abdera2.common.anno.Na
  */
 @Name("tv-episode")
 @Properties({
-  @Property(name="preview",to=MediaLink.class)
+  @Property(name="preview",to=MediaLink.class),
+  @Property(name="aired",to=DateTime.class)
 })
 @SuppressWarnings("unchecked")
 public class TvEpisodeObject extends CreativeWork {
@@ -65,6 +67,14 @@ public class TvEpisodeObject extends Cre
     setProperty("productionCompany", org);
   }
   
+  public DateTime getAired() {
+    return getProperty("aired");
+  }
+  
+  public void setAired(DateTime dt) {
+    setProperty("aired",dt);
+  }
+  
   public MediaLink getPreview() {
     return getProperty("preview");
   }
@@ -96,4 +106,58 @@ public class TvEpisodeObject extends Cre
   public void setEpisodeNumber(int episode) {
     setProperty("episode", episode);
   }
+  
+  
+  public static <T extends TvEpisodeObject>TvEpisodeObjectGenerator<T> makeTvEpisode() {
+    return new TvEpisodeObjectGenerator<T>();
+  }
+  
+  public static class TvEpisodeObjectGenerator<T extends TvEpisodeObject> extends CreativeWorkGenerator<T> {
+    public TvEpisodeObjectGenerator() {
+      super((Class<T>) TvEpisodeObject.class);
+    }
+    public TvEpisodeObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X actors(ASObject obj) {
+      item.setActors(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X director(ASObject obj) {
+      item.setDirector(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X episodeNumber(int n) {
+      item.setEpisodeNumber(n);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X season(ASObject obj) {
+      item.setSeason(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X series(ASObject obj) {
+      item.setSeries(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X musicBy(ASObject obj) {
+      item.setMusicBy(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X preview(MediaLink obj) {
+      item.setPreview(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X producer(ASObject obj) {
+      item.setProducer(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X productionCompany(ASObject obj) {
+      item.setProductionCompany(obj);
+      return (X)this;
+    }
+    public <X extends TvEpisodeObjectGenerator<T>>X aired(DateTime dateTime) {
+      item.setAired(dateTime);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeasonObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeasonObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeasonObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeasonObject.java Fri Oct 21 01:01:50 2011
@@ -1,12 +1,11 @@
 package org.apache.abdera2.activities.extra;
 
-import java.util.Date;
-
 import org.apache.abdera2.activities.io.gson.Properties;
 import org.apache.abdera2.activities.io.gson.Property;
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.activities.model.MediaLink;
 import org.apache.abdera2.common.anno.Name;
+import org.joda.time.DateTime;
 
 /**
  * A simple "objectType":"tv-season" object that serves primarily as an 
@@ -14,8 +13,8 @@ import org.apache.abdera2.common.anno.Na
  */
 @Name("tv-season")
 @Properties({
-  @Property(name="startDate",to=Date.class),
-  @Property(name="endDate",to=Date.class),
+  @Property(name="startDate",to=DateTime.class),
+  @Property(name="endDate",to=DateTime.class),
   @Property(name="preview",to=MediaLink.class)
 })
 @SuppressWarnings("unchecked")
@@ -33,7 +32,7 @@ public class TvSeasonObject extends Crea
     return (T)getProperty("actors");
   }
   
-  public void setActor(ASObject actors) {
+  public void setActors(ASObject actors) {
     setProperty("actors", actors);
   }
   
@@ -77,19 +76,19 @@ public class TvSeasonObject extends Crea
     setProperty("preview", link);
   }
   
-  public Date getStartDate() {
+  public DateTime getStartDate() {
     return getProperty("startDate");
   }
   
-  public void setStartDate(Date date) {
+  public void setStartDate(DateTime date) {
     setProperty("startDate", date);
   }
   
-  public Date getEndDate() {
+  public DateTime getEndDate() {
     return getProperty("endDate");
   }
   
-  public void setEndDate(Date date) {
+  public void setEndDate(DateTime date) {
     setProperty("endDate", date);
   }
   
@@ -116,4 +115,63 @@ public class TvSeasonObject extends Crea
   public void setSeasonNumber(int season) {
     setProperty("season", season);
   }
+  
+  
+  
+  public static <T extends TvSeasonObject>TvSeasonObjectGenerator<T> makeTvSeason() {
+    return new TvSeasonObjectGenerator<T>();
+  }
+  
+  public static class TvSeasonObjectGenerator<T extends TvSeasonObject> extends CreativeWorkGenerator<T> {
+    public TvSeasonObjectGenerator() {
+      super((Class<T>) TvSeasonObject.class);
+    }
+    public TvSeasonObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X actors(ASObject obj) {
+      item.setActors(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X director(ASObject obj) {
+      item.setDirector(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X seasonNumber(int n) {
+      item.setSeasonNumber(n);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X series(ASObject obj) {
+      item.setSeries(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X musicBy(ASObject obj) {
+      item.setMusicBy(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X preview(MediaLink obj) {
+      item.setPreview(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X producer(ASObject obj) {
+      item.setProducer(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X productionCompany(ASObject obj) {
+      item.setProductionCompany(obj);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X startDate(DateTime dt) {
+      item.setStartDate(dt);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X endDate(DateTime dt) {
+      item.setEndDate(dt);
+      return (X)this;
+    }
+    public <X extends TvSeasonObjectGenerator<T>>X episodes(ASObject obj) {
+      item.setEpisodes(obj);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeriesObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeriesObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeriesObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/TvSeriesObject.java Fri Oct 21 01:01:50 2011
@@ -1,12 +1,11 @@
 package org.apache.abdera2.activities.extra;
 
-import java.util.Date;
-
 import org.apache.abdera2.activities.io.gson.Properties;
 import org.apache.abdera2.activities.io.gson.Property;
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.activities.model.MediaLink;
 import org.apache.abdera2.common.anno.Name;
+import org.joda.time.DateTime;
 
 /**
  * A simple "objectType":"tv-series" object that serves primarily as an 
@@ -14,8 +13,8 @@ import org.apache.abdera2.common.anno.Na
  */
 @Name("tv-series")
 @Properties({
-  @Property(name="startDate",to=Date.class),
-  @Property(name="endDate",to=Date.class),
+  @Property(name="startDate",to=DateTime.class),
+  @Property(name="endDate",to=DateTime.class),
   @Property(name="preview",to=MediaLink.class)
 })
 @SuppressWarnings("unchecked")
@@ -33,7 +32,7 @@ public class TvSeriesObject extends Crea
     return (T)getProperty("actors");
   }
   
-  public void setActor(ASObject actors) {
+  public void setActors(ASObject actors) {
     setProperty("actors", actors);
   }
   
@@ -77,19 +76,19 @@ public class TvSeriesObject extends Crea
     setProperty("preview", link);
   }
   
-  public Date getStartDate() {
+  public DateTime getStartDate() {
     return getProperty("startDate");
   }
   
-  public void setStartDate(Date date) {
+  public void setStartDate(DateTime date) {
     setProperty("startDate", date);
   }
   
-  public Date getEndDate() {
+  public DateTime getEndDate() {
     return getProperty("endDate");
   }
   
-  public void setEndDate(Date date) {
+  public void setEndDate(DateTime date) {
     setProperty("endDate", date);
   }
   
@@ -108,4 +107,59 @@ public class TvSeriesObject extends Crea
   public void setEpisodes(ASObject episodes) {
     setProperty("episodes", episodes);
   }
+  
+  
+  
+  public static <T extends TvSeriesObject>TvSeriesObjectGenerator<T> makeTvSeries() {
+    return new TvSeriesObjectGenerator<T>();
+  }
+  
+  public static class TvSeriesObjectGenerator<T extends TvSeriesObject> extends CreativeWorkGenerator<T> {
+    public TvSeriesObjectGenerator() {
+      super((Class<T>) TvSeriesObject.class);
+    }
+    public TvSeriesObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X actors(ASObject obj) {
+      item.setActors(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X director(ASObject obj) {
+      item.setDirector(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X musicBy(ASObject obj) {
+      item.setMusicBy(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X preview(MediaLink obj) {
+      item.setPreview(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X producer(ASObject obj) {
+      item.setProducer(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X productionCompany(ASObject obj) {
+      item.setProductionCompany(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X episodes(ASObject obj) {
+      item.setEpisodes(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X seasons(ASObject obj) {
+      item.setSeasons(obj);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X startDate(DateTime dt) {
+      item.setStartDate(dt);
+      return (X)this;
+    }
+    public <X extends TvSeriesObjectGenerator<T>>X endDate(DateTime dt) {
+      item.setEndDate(dt);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/VersionObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/VersionObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/VersionObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/extra/VersionObject.java Fri Oct 21 01:01:50 2011
@@ -13,7 +13,9 @@ import org.apache.abdera2.common.anno.Na
 @Name("version")
 @Properties({
   @Property(name="previousVersion", to=VersionObject.class),
-  @Property(name="nextVersion",to=VersionObject.class)
+  @Property(name="nextVersion",to=VersionObject.class),
+  @Property(name="stableVersion",to=VersionObject.class),
+  @Property(name="activeVersion",to=VersionObject.class)
 })
 public class VersionObject 
   extends ASObject {
@@ -94,4 +96,49 @@ public class VersionObject 
     setProperty("revision", val);
   }
   
+  public static <T extends VersionObject>VersionObjectGenerator<T> makeVersion() {
+    return new VersionObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class VersionObjectGenerator<T extends VersionObject> extends ASObjectGenerator<T> {
+    public VersionObjectGenerator() {
+      super((Class<? extends T>) VersionObject.class);
+    }
+    public VersionObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends VersionObjectGenerator<T>>X active(VersionObject object) {
+      item.setActiveVersion(object);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X major(String val) {
+      item.setMajor(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X minor(String val) {
+      item.setMinor(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X next(VersionObject val) {
+      item.setNextVersion(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X of(ASObject val) {
+      item.setOf(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X previous(VersionObject val) {
+      item.setPreviousVersion(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X revision(String val) {
+      item.setRevision(val);
+      return (X)this;
+    }
+    public <X extends VersionObjectGenerator<T>>X stable(VersionObject val) {
+      item.setStableVersion(val);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java Fri Oct 21 01:01:50 2011
@@ -423,4 +423,140 @@ public class ASObject extends ASBase {
   public boolean is(ASObject obj) {
     return Extra.sameIdentity(this).apply(obj);
   }
+  
+  public static <X extends ASObjectGenerator<T>,T extends ASObject>X make() {
+    return (X)new ASObjectGenerator<T>();
+  }
+  
+  public static class ASObjectGenerator<T extends ASObject> extends Generator<T> {
+
+    public ASObjectGenerator() {
+      super((Class<? extends T>) ASObject.class);
+      startNew();
+    }
+    
+    public ASObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+      startNew();
+    }
+
+    public <X extends ASObjectGenerator<T>>X attachment(ASObject object) {
+      item.addAttachment(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X downstreamDuplicate(String id) {
+      item.addDownstreamDuplicate(id);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X inReplyTo(ASObject object) {
+      item.addInReplyTo(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X tag(ASObject object) {
+      item.addTag(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X upstreamDuplicate(String id) {
+      item.addUpstreamDuplicate(id);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X author(ASObject object) {
+      item.setAuthor(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X content(String content) {
+      item.setContent(content);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X displayName(String displayName) {
+      item.setDisplayName(displayName);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X embed(ASObject object) {
+      item.setEmbed(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X embeddedExperience(EmbeddedExperience ee) {
+      item.setEmbeddedExperience(ee);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X id(String id) {
+      item.setId(id);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X image(MediaLink link) {
+      item.setImage(link);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X location(PlaceObject object) {
+      item.setLocation(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X mood(Mood mood) {
+      item.setMood(mood);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X objectType(String type) {
+      item.setObjectType(type);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X published(DateTime dt) {
+      item.setPublished(dt);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X publishedNow() {
+      item.setPublishedNow();
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X rating(double rating) {
+      item.setRating(rating);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X source(ASObject object) {
+      item.setSource(object);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X summary(String summary) {
+      item.setSummary(summary);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X updated(DateTime dt) {
+      item.setUpdated(dt);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X updatedNow() {
+      item.setUpdatedNow();
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X url(IRI url) {
+      item.setUrl(url);
+      return (X)this;
+    }
+    
+    public <X extends ASObjectGenerator<T>>X url(String url) {
+      return url(new IRI(url));
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java Fri Oct 21 01:01:50 2011
@@ -316,4 +316,64 @@ public class Activity extends ASObject {
       list.add(obj);
   }
 
+  public static ActivityGenerator make() {
+    return new ActivityGenerator();
+  }
+  
+  public static class ActivityGenerator extends ASObjectGenerator<Activity> {
+    ActivityGenerator() {
+      super(Activity.class);
+    }
+    protected ActivityGenerator(Class<? extends Activity> _class) {
+      super(_class);
+    }
+    public <T extends ActivityGenerator>T to(ASObject object) {
+      item.addAudience(Audience.TO, object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T cc(ASObject object) {
+      item.addAudience(Audience.CC, object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T bcc(ASObject object) {
+      item.addAudience(Audience.BCC, object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T bto(ASObject object) {
+      item.addAudience(Audience.BTO, object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T actor(ASObject object) {
+      item.setActor(object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T generator(ASObject object) {
+      item.setGenerator(object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T icon(MediaLink link) {
+      item.setIcon(link);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T object(ASObject object) {
+      item.setObject(object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T provider(ASObject object) {
+      item.setProvider(object);
+      return (T)this;
+    }
+    public <T extends ActivityGenerator>T target(ASObject object) {
+      item.setTarget(object);
+      return (T)this;
+    }
+    public <X extends ActivityGenerator>X title(String title) {
+      item.setTitle(title);
+      return (X)this;
+    }
+    public <T extends ActivityGenerator>T verb(Verb verb) {
+      item.setVerb(verb);
+      return (T)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java Fri Oct 21 01:01:50 2011
@@ -124,4 +124,30 @@ public class Collection<T extends ASObje
     setTotalItems(list.size());
   }
   
+  public static <T extends ASObject>CollectionGenerator<T> make() {
+    return new CollectionGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class CollectionGenerator<T extends ASObject> 
+    extends ASObjectGenerator<Collection<T>> {
+    
+    public CollectionGenerator() {
+      super((Class<? extends Collection<T>>) Collection.class);
+    }
+    
+    public CollectionGenerator(Class<? extends Collection<T>> _class) {
+      super(_class);
+    }
+    
+    public <X extends CollectionGenerator<T>>X totalItems(int items) {
+      item.setTotalItems(items);
+      return (X)this;
+    }
+    
+    public <X extends CollectionGenerator<T>>X item(T item) {
+      this.item.addItem(item);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java Fri Oct 21 01:01:50 2011
@@ -66,4 +66,56 @@ public class EmbeddedExperience 
   public void setPreviewImage(String iri) {
     setGadget(new IRI(iri));
   }
+  
+  public static EmbeddedExperienceGenerator make() {
+    return new EmbeddedExperienceGenerator();
+  }
+  
+  public static class EmbeddedExperienceGenerator 
+    extends Generator<EmbeddedExperience> {
+
+    public EmbeddedExperienceGenerator() {
+      super(EmbeddedExperience.class);
+    }
+    
+    public EmbeddedExperienceGenerator context(ASObject object) {
+      item.setContext(object);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator context(Map<String,Object> map) {
+      item.setContext(map);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator gadget(IRI iri) {
+      item.setGadget(iri);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator gadget(String iri) {
+      item.setGadget(iri);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator previewImage(IRI iri) {
+      item.setPreviewImage(iri);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator previewImage(String iri) {
+      item.setPreviewImage(iri);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator url(IRI iri) {
+      item.setUrl(iri);
+      return this;
+    }
+    
+    public EmbeddedExperienceGenerator url(String uri) {
+      item.setUrl(uri);
+      return this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java Fri Oct 21 01:01:50 2011
@@ -13,15 +13,15 @@ import com.google.common.base.Supplier;
 public class Generator<T extends ASBase> implements Supplier<T> {
 
   private final ASBase template;
-  private final Class<T> _class;
+  private final Class<? extends T> _class;
   
-  private T item;
+  protected T item;
   
-  public Generator(Class<T> _class) {
+  public Generator(Class<? extends T> _class) {
     this(_class,null);
   }
   
-  public Generator(Class<T> _class, ASBase template) {
+  public Generator(Class<? extends T> _class, ASBase template) {
     this._class = _class;
     this.template = template;
   }
@@ -31,13 +31,15 @@ public class Generator<T extends ASBase>
       throw new IllegalStateException();
     try {
       item = _class.newInstance();
-      for (String name : template) {
-        Object obj = template.getProperty(name);
-        item.setProperty(
-          name, 
-          obj instanceof Copyable ? 
-            ((Copyable)obj).copy() : 
-            obj);
+      if (template != null) {
+        for (String name : template) {
+          Object obj = template.getProperty(name);
+          item.setProperty(
+            name, 
+            obj instanceof Copyable ? 
+              ((Copyable)obj).copy() : 
+              obj);
+        }
       }
     } catch (Throwable t) {
       throw new RuntimeException(t);

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java Fri Oct 21 01:01:50 2011
@@ -79,4 +79,44 @@ public class MediaLink extends ASBase {
     setProperty(URL, url);
   }
   
+  public void setUrl(String url) {
+    setUrl(new IRI(url));
+  }
+  
+  public static MediaLinkGenerator make() {
+    return new MediaLinkGenerator();
+  }
+  
+  public static class MediaLinkGenerator extends Generator<MediaLink> {
+
+    public MediaLinkGenerator() {
+      super(MediaLink.class);
+    }
+    
+    public MediaLinkGenerator duration(int duration) {
+      item.setDuration(duration);
+      return this;
+    }
+    
+    public MediaLinkGenerator height(int height) {
+      item.setHeight(height);
+      return this;
+    }
+    
+    public MediaLinkGenerator width(int width) {
+      item.setWidth(width);
+      return this;
+    }
+    
+    public MediaLinkGenerator url(IRI iri) {
+      item.setUrl(iri);
+      return this;
+    }
+    
+    public MediaLinkGenerator url(String uri) {
+      item.setUrl(new IRI(uri));
+      return this;
+    }
+  }
+  
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java Fri Oct 21 01:01:50 2011
@@ -39,4 +39,30 @@ public class AccountObject 
   public void setUserId(String userid) {
     setProperty("userId", userid);
   }
+  
+  public static <T extends AccountObject>AccountGenerator<T> makeAccount() {
+    return new AccountGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class AccountGenerator<T extends AccountObject> extends ServiceObjectGenerator<T> {
+    public AccountGenerator() {
+      super((Class<? extends T>) AccountObject.class);
+    }
+    public AccountGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends AccountGenerator<T>>X domain(String domain) {
+      item.setDomain(domain);
+      return (X)this;
+    }
+    public <X extends AccountGenerator<T>>X username(String username) {
+      item.setUsername(username);
+      return (X)this;
+    }
+    public <X extends AccountGenerator<T>>X userId(String userid) {
+      item.setUserId(userid);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java Fri Oct 21 01:01:50 2011
@@ -88,4 +88,42 @@ public class Address extends ASObject {
     }
     return buf.toString();
   }
+  
+  public static <T extends Address>AddressGenerator<T> makeAddress() {
+    return new AddressGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class AddressGenerator<T extends Address> extends ASObjectGenerator<T> {
+    public AddressGenerator() {
+      super((Class<? extends T>) Address.class);
+    }
+    public AddressGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends AddressGenerator<T>>X country(String country) {
+      item.setCountry(country);
+      return (X)this;
+    }
+    public <X extends AddressGenerator<T>>X formatted(String formatted) {
+      item.setFormatted(formatted);
+      return (X)this;
+    }
+    public <X extends AddressGenerator<T>>X locality(String locality) {
+      item.setLocality(locality);
+      return (X)this;
+    }
+    public <X extends AddressGenerator<T>>X postalCode(String postalCode) {
+      item.setPostalCode(postalCode);
+      return (X)this;
+    }
+    public <X extends AddressGenerator<T>>X region(String region) {
+      item.setRegion(region);
+      return (X)this;
+    }
+    public <X extends AddressGenerator<T>>X streetAddress(String address) {
+      item.setStreetAddress(address);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java Fri Oct 21 01:01:50 2011
@@ -32,4 +32,17 @@ public class ArticleObject 
     setDisplayName(displayName);
   }
   
+  public static <T extends ArticleObject>ArticleObjectGenerator<T> makeArticle() {
+    return new ArticleObjectGenerator<T>();
+  }
+  
+  public static class ArticleObjectGenerator<T extends ArticleObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public ArticleObjectGenerator() {
+      super((Class<? extends T>) ArticleObject.class);
+    }
+    public ArticleObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java Fri Oct 21 01:01:50 2011
@@ -51,4 +51,25 @@ public class AudioObject 
     setProperty(STREAM, stream);
   }
 
+  public static <T extends AudioObject>AudioObjectGenerator<T> makeAudio() {
+    return new AudioObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class AudioObjectGenerator<T extends AudioObject> extends ASObjectGenerator<T> {
+    public AudioObjectGenerator() {
+      super((Class<? extends T>) AudioObject.class);
+    }
+    public AudioObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends AudioObjectGenerator<T>>X embedCode(String code) {
+      item.setEmbedCode(code);
+      return (X)this;
+    }
+    public <X extends AudioObjectGenerator<T>>X stream(MediaLink stream) {
+      item.setStream(stream);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java Fri Oct 21 01:01:50 2011
@@ -32,4 +32,17 @@ public class BadgeObject 
     setDisplayName(displayName);
   }
   
+  public static <T extends BadgeObject>BadgeObjectGenerator<T> makeBadge() {
+    return new BadgeObjectGenerator<T>();
+  }
+  
+  public static class BadgeObjectGenerator<T extends BadgeObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public BadgeObjectGenerator() {
+      super((Class<? extends T>) BadgeObject.class);
+    }
+    public BadgeObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java Fri Oct 21 01:01:50 2011
@@ -19,6 +19,7 @@ package org.apache.abdera2.activities.mo
 
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
 
 @Name("bookmark")
 public class BookmarkObject 
@@ -41,4 +42,25 @@ public class BookmarkObject 
     setProperty(TARGETURL, targetUrl);
   }
 
+  public static <T extends BookmarkObject>BookmarkObjectGenerator<T> makeBookmark() {
+    return new BookmarkObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class BookmarkObjectGenerator<T extends BookmarkObject> extends ASObjectGenerator<T> {
+    public BookmarkObjectGenerator() {
+      super((Class<? extends T>) BookmarkObject.class);
+    }
+    public BookmarkObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends BookmarkObjectGenerator<T>>X targetUrl(String uri) {
+      item.setTargetUrl(uri);
+      return (X)this;
+    }
+    public <X extends BookmarkObjectGenerator<T>>X targetUrl(IRI uri) {
+      item.setTargetUrl(uri != null ? uri.toString() : null);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java Fri Oct 21 01:01:50 2011
@@ -32,4 +32,17 @@ public class CommentObject 
     setDisplayName(displayName);
   }
 
+  public static <T extends CommentObject>CommentObjectGenerator<T> makeComment() {
+    return new CommentObjectGenerator<T>();
+  }
+  
+  public static class CommentObjectGenerator<T extends CommentObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public CommentObjectGenerator() {
+      super((Class<? extends T>) CommentObject.class);
+    }
+    public CommentObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/EventObject.java Fri Oct 21 01:01:50 2011
@@ -17,11 +17,10 @@
  */
 package org.apache.abdera2.activities.model.objects;
 
-import java.util.Date;
-
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.activities.model.Collection;
 import org.apache.abdera2.common.anno.Name;
+import org.joda.time.DateTime;
 
 @Name("event")
 public class EventObject 
@@ -62,11 +61,11 @@ public class EventObject 
     setProperty(ATTENDING, attending);
   }
   
-  public Date getEndTime() {
+  public DateTime getEndTime() {
     return getProperty(ENDTIME);
   }
   
-  public void setEndTime(Date endTime) {
+  public void setEndTime(DateTime endTime) {
     setProperty(ENDTIME, endTime);
   }
   
@@ -94,12 +93,52 @@ public class EventObject 
     setProperty(NOTATTENDING, notAttending);
   }
   
-  public Date getStartTime() {
+  public DateTime getStartTime() {
     return getProperty(STARTTIME);
   }
   
-  public void setStartTime(Date startTime) {
+  public void setStartTime(DateTime startTime) {
     setProperty(STARTTIME, startTime);
   }
 
+  public static <T extends EventObject>EventObjectGenerator<T> makeEvent() {
+    return new EventObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class EventObjectGenerator<T extends EventObject> extends ASObjectGenerator<T> {
+
+    public EventObjectGenerator() {
+      super((Class<? extends T>) EventObject.class);
+    }
+    
+    public EventObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+    
+    public <X extends EventObjectGenerator<T>>X attending(Collection<ASObject> col) {
+      item.setAttending(col);
+      return (X)this;
+    }
+    
+    public <X extends EventObjectGenerator<T>>X endTime(DateTime dt) {
+      item.setEndTime(dt);
+      return (X)this;
+    }
+    
+    public <X extends EventObjectGenerator<T>>X maybeAttending(Collection<ASObject> col) {
+      item.setMaybeAttending(col);
+      return (X)this;
+    }
+    
+    public <X extends EventObjectGenerator<T>>X notAttending(Collection<ASObject> col) {
+      item.setNotAttending(col);
+      return (X)this;
+    }
+    
+    public <X extends EventObjectGenerator<T>>X startTime(DateTime t) {
+      item.setStartTime(t);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/FileObject.java Fri Oct 21 01:01:50 2011
@@ -46,6 +46,10 @@ public class FileObject 
     setProperty(FILEURL, fileUrl);
   }
   
+  public void setFileUrl(String fileUrl) {
+    setFileUrl(new IRI(fileUrl));
+  }
+  
   public MimeType getMimeType() {
     return getProperty("mimeType");
   }
@@ -61,4 +65,34 @@ public class FileObject 
       throw new org.apache.abdera2.common.mediatype.MimeTypeParseException(e);
     }
   }
+  
+  public static <T extends FileObject>FileObjectGenerator<T> makeFile() {
+    return new FileObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class FileObjectGenerator<T extends FileObject> extends ASObjectGenerator<T> {
+    public FileObjectGenerator() {
+      super((Class<? extends T>) FileObject.class);
+    }
+    public FileObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends FileObjectGenerator<T>>X fileUrl(IRI iri) {
+      item.setFileUrl(iri);
+      return (X)this;
+    }
+    public <X extends FileObjectGenerator<T>>X fileUrl(String uri) {
+      item.setFileUrl(uri);
+      return (X)this;
+    }
+    public <X extends FileObjectGenerator<T>>X mimeType(MimeType mimeType) {
+      item.setMimeType(mimeType);
+      return (X)this;
+    }
+    public <X extends FileObjectGenerator<T>>X mimeType(String mimeType) {
+      item.setMimeType(mimeType);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/GroupObject.java Fri Oct 21 01:01:50 2011
@@ -32,4 +32,17 @@ public class GroupObject 
     setDisplayName(displayName);
   }
 
+  public static <T extends GroupObject>GroupObjectGenerator<T> makeGroup() {
+    return new GroupObjectGenerator<T>();
+  }
+  
+  public static class GroupObjectGenerator<T extends GroupObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public GroupObjectGenerator() {
+      super((Class<? extends T>) GroupObject.class);
+    }
+    public GroupObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ImageObject.java Fri Oct 21 01:01:50 2011
@@ -41,4 +41,22 @@ public class ImageObject 
   public void setFullImage(MediaLink fullImage) {
     setProperty(FULLIMAGE, fullImage);
   }
+  
+  public static <T extends ImageObject>ImageObjectGenerator<T> makeImage() {
+    return new ImageObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class ImageObjectGenerator<T extends ImageObject> extends ASObjectGenerator<T> {
+    public ImageObjectGenerator() {
+      super((Class<? extends T>) ImageObject.class);
+    }
+    public ImageObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends ImageObjectGenerator<T>>X fullImage(MediaLink fullImage) {
+      item.setFullImage(fullImage);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Mood.java Fri Oct 21 01:01:50 2011
@@ -18,6 +18,7 @@
 package org.apache.abdera2.activities.model.objects;
 
 import org.apache.abdera2.activities.model.ASBase;
+import org.apache.abdera2.activities.model.Generator;
 import org.apache.abdera2.activities.model.MediaLink;
 
 public class Mood extends ASBase {
@@ -51,4 +52,26 @@ public class Mood extends ASBase {
   public String toString() {
     return getDisplayName();
   }
+  
+  public static <T extends Mood>MoodGenerator<T> makeMood() {
+    return new MoodGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class MoodGenerator<T extends Mood> extends Generator<T> {
+    public MoodGenerator() {
+      super((Class<? extends T>) Mood.class);
+    }
+    public MoodGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends MoodGenerator<T>>X displayName(String dn) {
+      item.setDisplayName(dn);
+      return (X)this;
+    }
+    public <X extends MoodGenerator<T>>X image(MediaLink link) {
+      item.setImage(link);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NameObject.java Fri Oct 21 01:01:50 2011
@@ -80,4 +80,54 @@ public class NameObject 
   public void setPronunciationUrl(String val) {
     setPronunciationUrl(new IRI(val));
   }
+  
+  public static <T extends NameObject>NameObjectGenerator<T> makeName() {
+    return new NameObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class NameObjectGenerator<T extends NameObject> extends ASObjectGenerator<T> {
+    public NameObjectGenerator() {
+      super((Class<? extends T>) NameObject.class);
+    }
+    public NameObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends NameObjectGenerator<T>>X familyName(String fn) {
+      item.setFamilyName(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X formatted(String fn) {
+      item.setFormatted(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X givenName(String fn) {
+      item.setGivenName(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X honorificPrefix(String fn) {
+      item.setHonorificPrefix(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X honorificSuffix(String fn) {
+      item.setHonorificSuffix(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X middleName(String fn) {
+      item.setMiddleName(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X pronunciation(String fn) {
+      item.setPronunciation(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X pronunciationUrl(String fn) {
+      item.setPronunciationUrl(fn);
+      return (X)this;
+    }
+    public <X extends NameObjectGenerator<T>>X pronunciationUrl(IRI fn) {
+      item.setPronunciationUrl(fn);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/NoteObject.java Fri Oct 21 01:01:50 2011
@@ -31,4 +31,18 @@ public class NoteObject 
   public NoteObject(String displayName) {
     setDisplayName(displayName);
   }  
+  
+  public static <T extends NoteObject>NoteObjectGenerator<T> makeNote() {
+    return new NoteObjectGenerator<T>();
+  }
+  
+  public static class NoteObjectGenerator<T extends NoteObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public NoteObjectGenerator() {
+      super((Class<? extends T>) NoteObject.class);
+    }
+    public NoteObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/OrganizationObject.java Fri Oct 21 01:01:50 2011
@@ -7,6 +7,7 @@ import org.apache.abdera2.activities.io.
 import org.apache.abdera2.activities.model.ASObject;
 import org.apache.abdera2.common.anno.Name;
 import org.apache.abdera2.common.iri.IRI;
+import org.joda.time.DateTime;
 
 @Name("organization")
 @Properties({
@@ -48,11 +49,11 @@ public class OrganizationObject extends 
     setProperty("description", description);
   }
   
-  public Date getEndDate() {
+  public DateTime getEndDate() {
     return getProperty("endDate");
   }
   
-  public void setEndDate(Date date) {
+  public void setEndDate(DateTime date) {
     setProperty("endDate", date);
   }
   
@@ -80,11 +81,11 @@ public class OrganizationObject extends 
     setProperty("salary", salary);
   }
   
-  public Date getStartDate() {
+  public DateTime getStartDate() {
     return getProperty("startDate");
   }
   
-  public void setStartDate(Date date) {
+  public void setStartDate(DateTime date) {
     setProperty("startDate", date);
   }
   
@@ -123,4 +124,70 @@ public class OrganizationObject extends 
   public void setWebpage(String val) {
     setWebpage(new IRI(val));
   }
+  
+  public static <T extends OrganizationObject>OrganizationObjectGenerator<T> makeOrganization() {
+    return new OrganizationObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class OrganizationObjectGenerator<T extends OrganizationObject> extends ASObjectGenerator<T> {
+    public OrganizationObjectGenerator() {
+      super((Class<? extends T>) OrganizationObject.class);
+    }
+    public OrganizationObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends OrganizationObjectGenerator<T>>X address(Address address) {
+      item.setAddress(address);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X department(String val) {
+      item.setDepartment(val);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X description(String val) {
+      item.setDescription(val);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X endDate(DateTime dt) {
+      item.setEndDate(dt);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X field(String field) {
+      item.setField(field);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X name(String name) {
+      item.setName(name);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X salary(String salary) {
+      item.setSalary(salary);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X startDate(DateTime dt) {
+      item.setStartDate(dt);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X subfield(String val) {
+      item.setSubfield(val);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X title(String val) {
+      item.setTitle(val);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X type(String val) {
+      item.setType(val);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X webpage(String uri) {
+      item.setWebpage(uri);
+      return (X)this;
+    }
+    public <X extends OrganizationObjectGenerator<T>>X webpage(IRI uri) {
+      item.setWebpage(uri);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PersonObject.java Fri Oct 21 01:01:50 2011
@@ -285,4 +285,103 @@ public class PersonObject 
     }
     list.add(org);
   }
+  
+  @SuppressWarnings("rawtypes")
+  public static <T extends PersonObject>PersonObjectGenerator makePerson() {
+    return new PersonObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class PersonObjectGenerator<T extends PersonObject> extends ASObjectGenerator<T> {
+    public PersonObjectGenerator() {
+      super((Class<T>)PersonObject.class);
+    }
+    public PersonObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+    public <X extends PersonObjectGenerator<T>>X account(AccountObject object) {
+      item.addAccount(object);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X address(Address object) {
+      item.addAddress(object);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X alternateName(NameObject name) {
+      item.addAlternateName(name);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X email(String email) {
+      item.addEmail(email);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X im(String im) {
+      item.addIm(im);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X organization(OrganizationObject object) {
+      item.addOrganization(object);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X phoneNumber(String pn) {
+      item.addPhoneNumber(pn);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X urls(String url) {
+      item.addUrl(url);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X urls(IRI url) {
+      item.addUrl(url);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X aboutMe(String val) {
+      item.setAboutMe(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X contactPreference(String val) {
+      item.setContactPreference(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X dn(String val) {
+      item.setDn(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X name(NameObject val) {
+      item.setName(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X nativeName(NameObject val) {
+      item.setNativeName(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X preferredName(NameObject val) {
+      item.setPreferredName(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X profileUrl(String val) {
+      item.setProfileUrl(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X profileUrl(IRI val) {
+      item.setProfileUrl(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X status(String val) {
+      item.setStatus(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X thumbnailUrl(String val) {
+      item.setThumbnailUrl(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X thumbnailUrl(IRI val) {
+      item.setThumbnailUrl(val);
+      return (X)this;
+    }
+    public <X extends PersonObjectGenerator<T>>X utcOffset(String val) {
+      item.setUtcOffset(val);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/PlaceObject.java Fri Oct 21 01:01:50 2011
@@ -50,4 +50,25 @@ public class PlaceObject 
     setProperty(ADDRESS, address);
   }
 
+  public static <T extends PlaceObject>PlaceObjectGenerator<T> makePlace() {
+    return new PlaceObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class PlaceObjectGenerator<T extends PlaceObject> extends ASObjectGenerator<T> {
+    public PlaceObjectGenerator() {
+      super((Class<? extends T>) PlaceObject.class);
+    }
+    public PlaceObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends PlaceObjectGenerator<T>>X position(String position) {
+      item.setPosition(position);
+      return (X)this;
+    }
+    public <X extends PlaceObjectGenerator<T>>X address(Address address) {
+      item.setAddress(address);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ProductObject.java Fri Oct 21 01:01:50 2011
@@ -42,4 +42,21 @@ public class ProductObject 
     setProperty(FULLIMAGE, fullImage);
   }
 
+  public static <T extends ProductObject>ProductObjectGenerator<T> makeProduct() {
+    return new ProductObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class ProductObjectGenerator<T extends ProductObject> extends ASObjectGenerator<T> {
+    public ProductObjectGenerator() {
+      super((Class<? extends T>) ProductObject.class);
+    }
+    public ProductObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends ProductObjectGenerator<T>>X fullImage(MediaLink fullImage) {
+      item.setFullImage(fullImage);
+      return (X)this;
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/QuestionObject.java Fri Oct 21 01:01:50 2011
@@ -53,6 +53,24 @@ public class QuestionObject 
     }
     list.add(option); 
   }
+  
+  public static <T extends QuestionObject>QuestionObjectGenerator<T> makeQuestion() {
+    return new QuestionObjectGenerator<T>();
+  }
 
+  @SuppressWarnings("unchecked")
+  public static class QuestionObjectGenerator<T extends QuestionObject> 
+    extends ASObjectGenerator<T> {
+    public QuestionObjectGenerator() {
+      super((Class<? extends T>) QuestionObject.class);
+    }
+    public QuestionObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends QuestionObjectGenerator<T>>X option(ASObject object) {
+      item.addOption(object);
+      return (X)this;
+    }
+  }
 }
 

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ReviewObject.java Fri Oct 21 01:01:50 2011
@@ -32,4 +32,17 @@ public class ReviewObject 
     setDisplayName(displayName);
   }
   
+  public static <T extends ReviewObject>ReviewObjectGenerator<T> makeReview() {
+    return new ReviewObjectGenerator<T>();
+  }
+  
+  public static class ReviewObjectGenerator<T extends ReviewObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public ReviewObjectGenerator() {
+      super((Class<? extends T>) ReviewObject.class);
+    }
+    public ReviewObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ServiceObject.java Fri Oct 21 01:01:50 2011
@@ -31,4 +31,18 @@ public class ServiceObject 
   public ServiceObject(String displayName) {
     setDisplayName(displayName);
   }  
+  
+  public static <T extends ServiceObject>ServiceObjectGenerator<T> makeService() {
+    return new ServiceObjectGenerator<T>();
+  }
+  
+  public static class ServiceObjectGenerator<T extends ServiceObject> extends ASObjectGenerator<T> {
+    @SuppressWarnings("unchecked")
+    public ServiceObjectGenerator() {
+      super((Class<? extends T>) ServiceObject.class);
+    }
+    public ServiceObjectGenerator(Class<? extends T> _class) {
+      super(_class);
+    }
+  }
 }

Modified: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java?rev=1187146&r1=1187145&r2=1187146&view=diff
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java (original)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/VideoObject.java Fri Oct 21 01:01:50 2011
@@ -49,4 +49,26 @@ public class VideoObject 
   public void setStream(MediaLink stream) {
     setProperty(STREAM, stream);
   }
+  
+  public static <T extends VideoObject>VideoObjectGenerator<T> makeVideo() {
+    return new VideoObjectGenerator<T>();
+  }
+  
+  @SuppressWarnings("unchecked")
+  public static class VideoObjectGenerator<T extends VideoObject> extends ASObjectGenerator<T> {
+    public VideoObjectGenerator() {
+      super((Class<? extends T>) VideoObject.class);
+    }
+    public VideoObjectGenerator(Class<T> _class) {
+      super(_class);
+    }
+    public <X extends VideoObjectGenerator<T>>X embedCode(String code) {
+      item.setEmbedCode(code);
+      return (X)this;
+    }
+    public <X extends VideoObjectGenerator<T>>X stream(MediaLink stream) {
+      item.setStream(stream);
+      return (X)this;
+    }
+  }
 }



Mime
View raw message