abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1173209 [3/49] - in /abdera/abdera2: ./ .settings/ activities/ activities/src/ activities/src/main/ activities/src/main/java/ activities/src/main/java/org/ activities/src/main/java/org/apache/ activities/src/main/java/org/apache/abdera2/ a...
Date Tue, 20 Sep 2011 15:57:20 GMT
Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IntervalAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IriAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IriAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IriAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IriAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import org.apache.abdera2.common.iri.IRI;
+
+@AdaptedType(IRI.class)
+public class IriAdapter 
+  extends SimpleAdapter<IRI> {
+  
+  protected IRI deserialize(String v) {
+    return new IRI(v);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/IriAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/LangAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/LangAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/LangAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/LangAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import org.apache.abdera2.common.lang.Lang;
+
+@AdaptedType(Lang.class)
+public class LangAdapter 
+  extends SimpleAdapter<Lang> {
+
+  protected Lang deserialize(String v) {
+    return Lang.parse(v);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/LangAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/MimeTypeAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/MimeTypeAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/MimeTypeAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/MimeTypeAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import javax.activation.MimeType;
+
+@AdaptedType(MimeType.class)
+public class MimeTypeAdapter
+  extends SimpleAdapter<MimeType> {
+
+  protected MimeType deserialize(String v) {
+    try {
+      return new MimeType(v);
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/MimeTypeAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/PositionAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/PositionAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/PositionAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/PositionAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import org.apache.abdera2.common.geo.IsoPosition;
+
+@AdaptedType(IsoPosition.class)
+public class PositionAdapter 
+  extends SimpleAdapter<IsoPosition> {
+
+  protected IsoPosition deserialize(String v) {
+    return IsoPosition.parse(v);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/PositionAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Properties.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Properties.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Properties.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Properties.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+@Target( {TYPE})
+public @interface Properties {
+  Property[] value();
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Properties.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Property.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Property.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Property.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Property.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+@Target( {TYPE})
+public @interface Property {
+  String name();
+  Class<?> to();
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/Property.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/SimpleAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/SimpleAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/SimpleAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/SimpleAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,55 @@
+package org.apache.abdera2.activities.io.gson;
+
+import java.lang.reflect.Type;
+
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonSerializationContext;
+
+public abstract class SimpleAdapter<T>
+  implements GsonTypeAdapter<T> {
+
+  private final Class<T> _class;
+  
+  public SimpleAdapter() {
+    this._class = _getAdaptedClass(this.getClass());
+  }
+  
+  @SuppressWarnings("unchecked")
+  private static <T>Class<T> _getAdaptedClass(Class<?> _class) {
+    if (_class.isAnnotationPresent(AdaptedType.class)) {
+      AdaptedType at = _class.getAnnotation(AdaptedType.class);
+      return (Class<T>) at.value();
+    } else throw new IllegalArgumentException();
+  }
+  
+  public SimpleAdapter(Class<T> _class) {
+    this._class = _class;
+  }
+  
+  public Class<T> getAdaptedClass() {
+    return _class;
+  }
+
+  public JsonElement serialize(
+    T t, 
+    Type type, 
+    JsonSerializationContext context) {
+      return context.serialize(serialize(t));
+  }
+
+  protected String serialize(T t) {
+    return t != null ? t.toString() : null;
+  }
+  
+  protected abstract T deserialize(String v);
+  
+  public T deserialize(
+    JsonElement json, 
+    Type type,
+    JsonDeserializationContext context) 
+      throws JsonParseException {
+    return deserialize(json.getAsJsonPrimitive().getAsString());
+  }
+}
\ No newline at end of file

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/SimpleAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/TemplateAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/TemplateAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/TemplateAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/TemplateAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import org.apache.abdera2.common.templates.Template;
+
+@AdaptedType(Template.class)
+public class TemplateAdapter 
+  extends SimpleAdapter<Template> {
+
+  protected Template deserialize(String v) {
+    return new Template(v);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/TemplateAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/VerbAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/VerbAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/VerbAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/VerbAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.io.gson;
+
+import org.apache.abdera2.activities.model.Verb;
+
+@AdaptedType(Verb.class)
+public class VerbAdapter 
+  extends SimpleAdapter<Verb> {
+
+  protected Verb deserialize(String v) {
+    return Verb.get(v);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/io/gson/VerbAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,278 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Serializable;
+import java.io.Writer;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.activation.MimeType;
+
+import org.apache.abdera2.activities.model.Generator.Copyable;
+import org.apache.abdera2.common.http.EntityTag;
+import org.apache.abdera2.common.iri.IRI;
+import org.apache.abdera2.common.lang.Lang;
+import org.apache.abdera2.common.mediatype.MimeTypeParseException;
+
+public class ASBase 
+  implements Iterable<String>, Cloneable, Serializable, Copyable {
+
+  private static final long serialVersionUID = -5432906925445653268L;
+  private final Map<String,Object> exts =
+    new HashMap<String,Object>();
+  
+  public ASBase() {}
+  
+  public void setLang(Lang lang) {
+    setProperty("lang", lang);
+  }
+  
+  public Lang getLang() {
+    return getProperty("lang");
+  }
+  
+  @SuppressWarnings("unchecked")
+  public <T>T getProperty(String name) {
+    return (T)exts.get(name);
+  }
+  
+  public void setProperty(String name, Object value) {
+    if (value != null)
+      exts.put(name, value);
+    else if (exts.containsKey(name))
+      exts.remove(name);
+  }
+
+  public Iterator<String> iterator() {
+    return exts.keySet().iterator();
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((exts == null) ? 0 : exts.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null)
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    ASBase other = (ASBase) obj;
+    if (exts == null) {
+      if (other.exts != null)
+        return false;
+    } else if (!exts.equals(other.exts))
+      return false;
+    return true;
+  }
+
+  public <T extends ASBase>T as(Class<T> type) {
+    try {
+      // if we already implement the type, just return 
+      // casted as that type... otherwise, create a 
+      // new instance and copy all the properties over
+      if (type.isAssignableFrom(this.getClass()))
+        return type.cast(this);
+      ASBase t = type.newInstance();
+      t.exts.putAll(exts);
+      t.contentType = contentType;
+      t.lastModified = lastModified;
+      t.entityTag = entityTag;
+      t.language = language;
+      t.slug = slug;
+      t.base = base;      
+      return type.cast(t);
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+ 
+  public String toString() {
+    return IO.get().write(this);
+  }
+  
+  public void writeTo(IO io, Writer out) {
+    io.write(this,out);
+  }
+  
+  public void writeTo(IO io, OutputStream out, String charset) {
+    io.write(this,out,charset);
+  }
+  
+  public void writeTo(IO io, OutputStream out) {
+    io.write(this,out,"UTF-8");
+  }
+  
+  public void writeTo(Writer out) {
+    IO.get().write(this,out);
+  }
+  
+  public void writeTo(Writer out, TypeAdapter<?>... adapters) {
+    IO.get(adapters).write(this,out);
+  }
+  
+  public void writeTo(OutputStream out, String charset) {
+    try {
+      OutputStreamWriter writer = 
+        new OutputStreamWriter(out,charset);
+      writeTo(writer);
+      writer.flush();
+    } catch (Throwable t) {}
+  }
+
+  public void writeTo(OutputStream out, String charset, TypeAdapter<?>... adapters) {
+    try {
+      OutputStreamWriter writer =
+        new OutputStreamWriter(out,charset);
+      writeTo(writer,adapters);
+      writer.flush();
+    } catch (Throwable t) {}
+  }
+  
+  public void writeTo(OutputStream out) {
+    writeTo(out,"UTF-8");
+  }
+
+  public void writeTo(OutputStream out, TypeAdapter<?>... adapters) {
+    writeTo(out,"UTF-8",adapters);
+  }
+  
+  /////// DOCUMENT PROPERTIES ///////
+  
+  private MimeType contentType;
+  private Date lastModified;
+  private EntityTag entityTag;
+  private Lang language;
+  private String slug;
+  private IRI base;
+  
+  public MimeType getContentType() {
+    return contentType;
+  }
+  
+  public void setContentType(String mimeType) {
+    try {
+      this.contentType = new MimeType(mimeType);
+    } catch (javax.activation.MimeTypeParseException t) {
+      throw new MimeTypeParseException(t);
+    }
+  }
+  
+  public void setContentType(MimeType mimeType) {
+    this.contentType = mimeType;
+  }
+  
+  public Date getLastModified() {
+    return lastModified;
+  }
+  
+  public void setLastModified(Date lastModified) {
+    this.lastModified = lastModified;
+  }
+  
+  public EntityTag getEntityTag() {
+    return entityTag;
+  }
+  
+  public void setEntityTag(EntityTag entityTag) {
+    this.entityTag = entityTag;
+  }
+  
+  public void setEntityTag(String entityTag) {
+    this.entityTag = new EntityTag(entityTag);
+  }
+  
+  public Lang getLanguage() {
+    return language;
+  }
+  
+  public void setLanguage(Lang language) {
+    this.language = language;
+  }
+  
+  public void setLanguage(String language) {
+    this.language = new Lang(language);
+  }
+  
+  public String getSlug() {
+    return slug;
+  }
+  
+  public void setSlug(String slug) {
+    this.slug = slug;
+  }
+  
+  public IRI getBaseUri() {
+    return base;
+  }
+  
+  public void setBaseUri(IRI iri) {
+    this.base = iri;
+  }
+  
+  public void setBaseUri(String iri) {
+    this.base = new IRI(iri);
+  }
+  
+  @SuppressWarnings({ "rawtypes", "unchecked" })
+  public <T extends ASObject>Generator<T> newGenerator() {
+    return (Generator<T>)new Generator(getClass(),this);
+  }
+
+  public Object copy() {
+    try {
+      Class<?> _class = this.getClass();
+      ASBase copy = (ASBase) _class.newInstance();
+      for (String name : this) {
+        // do a potentially deep copy
+        Object val = getProperty(name);
+        copy.setProperty(
+          name,
+          val instanceof Copyable ? 
+            ((Copyable)val).copy() : 
+            val);
+      }
+      copy.contentType = contentType;
+      copy.lastModified = lastModified;
+      copy.entityTag = entityTag;
+      copy.language = language;
+      copy.slug = slug;
+      copy.base = base;
+      return copy;
+    } catch (Throwable t) {
+      throw new RuntimeException();
+    }
+  }
+  
+  public boolean has(String name) {
+    return exts.containsKey(name);
+  }
+}
+
+

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASBase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,333 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.objects.Mood;
+import org.apache.abdera2.activities.model.objects.PersonObject;
+import org.apache.abdera2.activities.model.objects.PlaceObject;
+import org.apache.abdera2.common.anno.AnnoUtil;
+import org.apache.abdera2.common.iri.IRI;
+
+
+@SuppressWarnings("unchecked")
+public class ASObject extends ASBase {
+
+  private static final long serialVersionUID = -6969558559101109831L;
+  public static final String ATTACHMENTS = "attachments";
+  public static final String AUTHOR = "author";
+  public static final String CONTENT = "content";
+  public static final String DISPLAYNAME = "displayName";
+  public static final String DOWNSTREAMDUPLICATES = "downstreamDuplicates";
+  public static final String ID = "id";
+  public static final String IMAGE = "image";
+  public static final String OBJECTTYPE = "objectType";
+  public static final String PUBLISHED = "published";
+  public static final String SUMMARY = "summary";
+  public static final String UPDATED = "updated";
+  public static final String UPSTREAMDUPLICATES = "upstreamDuplicates";
+  public static final String URL = "url";
+  
+  public static final String INREPLYTO = "inReplyTo";
+  public static final String LOCATION = "location";
+  public static final String SOURCE = "source";
+  public static final String MOOD = "mood";
+  public static final String TAGS = "tags";
+  public static final String RATING = "rating";
+  
+  public ASObject() {
+    setObjectType(AnnoUtil.getName(this));
+  }
+  
+  public ASObject(String objectType) {
+    setObjectType(objectType);
+  }
+  
+  public Iterable<ASObject> getAttachments() {
+    return getProperty(ATTACHMENTS);
+  }
+  
+  public void setAttachments(Set<ASObject> attachments) {
+    setProperty(ATTACHMENTS, attachments);
+  }
+  
+  public void addAttachment(ASObject attachment) {
+    Set<ASObject> attachments = getProperty(ATTACHMENTS);
+    if (attachments == null) {
+      attachments = new HashSet<ASObject>();
+      setProperty(ATTACHMENTS, attachments);
+    }
+    attachments.add(attachment);
+    
+  }
+  
+  public <E extends ASObject>E getAuthor() {
+    return (E)getProperty(AUTHOR);
+  }
+  
+  public <E extends ASObject>E getAuthor(boolean create) {
+    ASObject obj = getAuthor();
+    if (obj == null && create) {
+      obj = new PersonObject();
+      setAuthor(obj);
+    }
+    return (E)obj;
+  }
+  
+  public void setAuthor(ASObject author) {
+    setProperty(AUTHOR, author);
+  }
+  
+  public <E extends ASObject>E setAuthor(String displayName) {
+    ASObject obj = getAuthor(true);
+    obj.setDisplayName(displayName);
+    return (E)obj;
+  }
+  
+  public String getContent() {
+    return getProperty(CONTENT);
+  }
+  
+  public void setContent(String content) {
+    setProperty(CONTENT, content);
+    
+  }
+  
+  public String getDisplayName() {
+    return getProperty(DISPLAYNAME);
+  }
+  
+  public void setDisplayName(String displayName) {
+    setProperty(DISPLAYNAME, displayName);
+    
+  }
+  
+  public Iterable<String> getDownstreamDuplicates() {
+    return getProperty(DOWNSTREAMDUPLICATES);
+  }
+  
+  public void setDownstreamDuplicates(Set<String> downstreamDuplicates) {
+    setProperty(DOWNSTREAMDUPLICATES, downstreamDuplicates);
+    
+  }
+  
+  public void addDownstreamDuplicate(String downstreamDuplicate) {
+    Set<String> downstreamDuplicates = getProperty(DOWNSTREAMDUPLICATES);
+    if (downstreamDuplicates == null) {
+      downstreamDuplicates = new HashSet<String>();
+      setProperty(DOWNSTREAMDUPLICATES, downstreamDuplicates);
+    }
+    downstreamDuplicates.add(downstreamDuplicate);
+    
+  }
+  
+  public String getId() {
+    return getProperty(ID);
+  }
+  
+  public void setId(String id) {
+    setProperty(ID, id);
+    
+  }
+  
+  public MediaLink getImage() {
+    return getProperty(IMAGE);
+  }
+  
+  public void setImage(MediaLink image) {
+    setProperty(IMAGE, image);
+    
+  }
+  
+  public String getObjectType() {
+    return getProperty(OBJECTTYPE);
+  }
+  
+  public void setObjectType(String objectType) {
+    if (objectType != null && ASObject.class.getSimpleName().equalsIgnoreCase(objectType))
+      objectType = null;
+    setProperty(OBJECTTYPE, objectType);
+    
+  }
+  
+  public Date getPublished() {
+    return getProperty(PUBLISHED);
+  }
+  
+  public void setPublished(Date published) {
+    setProperty(PUBLISHED, published);
+    
+  }
+  
+  public String getSummary() {
+    return getProperty(SUMMARY);
+  }
+  
+  public void setSummary(String summary) {
+    setProperty(SUMMARY, summary);
+    
+  }
+  
+  public Date getUpdated() {
+    return getProperty(UPDATED);
+  }
+  
+  public void setUpdated(Date updated) {
+    setProperty(UPDATED, updated);
+    
+  }
+  
+  public Iterable<String> getUpstreamDuplicates() {
+    return getProperty(UPSTREAMDUPLICATES);
+  }
+  
+  public void setUpstreamDuplicates(Set<String> upstreamDuplicates) {
+    setProperty(UPSTREAMDUPLICATES, upstreamDuplicates);
+    
+  }
+  
+  public void addUpstreamDuplicate(String upstreamDuplicate) {
+    Set<String> upstreamDuplicates = getProperty(UPSTREAMDUPLICATES);
+    if (upstreamDuplicates == null) {
+      upstreamDuplicates = new HashSet<String>();
+      setProperty(UPSTREAMDUPLICATES, upstreamDuplicates);
+    }
+    upstreamDuplicates.add(upstreamDuplicate);
+  }
+  
+  
+  public IRI getUrl() {
+    return getProperty(URL);
+  }
+  
+  public void setUrl(IRI url) {
+    setProperty(URL,url);
+  }
+  
+  public Iterable<ASObject> getInReplyTo() {
+    return getProperty(INREPLYTO);
+  }
+  
+  public void setInReplyTo(Set<ASObject> inReplyTo) {
+    setProperty(INREPLYTO, inReplyTo);
+  }
+  
+  public void addInReplyTo(ASObject inReplyTo) {
+    Set<ASObject> list = getProperty(INREPLYTO);
+    if (list == null) {
+      list = new HashSet<ASObject>();
+      setProperty(INREPLYTO, list);
+    }
+    list.add(inReplyTo);
+  }
+  
+  public PlaceObject getLocation() {
+    return getProperty(LOCATION);
+  }
+  
+  public void setLocation(PlaceObject location) {
+    setProperty(LOCATION, location);
+    location.setObjectType(null);
+  }
+  
+  public Mood getMood() {
+    return getProperty(MOOD);
+  }
+  
+  public void setMood(Mood mood) {
+    setProperty(MOOD, mood);
+  }
+  
+  public <E extends ASObject>E getSource() {
+    return (E)getProperty(SOURCE);
+  }
+  
+  public void setSource(ASObject source) {
+    setProperty(SOURCE, source);
+  }
+
+  public Iterable<ASObject> getTags() {
+    return getProperty(TAGS);
+  }
+  
+  public void setTags(Set<ASObject> tags) {
+    setProperty(TAGS, tags);
+  }
+  
+  public void addTag(ASObject tag) {
+    Set<ASObject> list = getProperty(TAGS);
+    if (list == null) {
+      list = new HashSet<ASObject>();
+      setProperty(TAGS, list);
+    }
+    list.add(tag); 
+  }
+  
+  public double getRating() {
+    return (Double)getProperty(RATING);
+  }
+  
+  public void setRating(double rating) {
+    setProperty(RATING, rating);
+  }
+  
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    String objectType = getObjectType();
+    if (objectType != null) {
+      char s = objectType.charAt(0);
+      if ("aeiou".indexOf(s) > -1) 
+        sb.append("an ");
+      else sb.append("a ");
+      sb.append(objectType);
+    } else {
+      sb.append("an object");
+    }
+    return sb.toString();
+  }
+
+  public void setEmbeddedExperience(EmbeddedExperience embed) {
+    ASBase os = getProperty("openSocial");
+    if (os == null) {
+      os = new ASBase();
+      setProperty("openSocial", os);
+    }
+    os.setProperty("embed", embed);
+  }
+  
+  public EmbeddedExperience getEmbeddedExperience() {
+    if (!has("openSocial")) return null;
+    ASBase os = getProperty("openSocial");
+    if (!os.has("embed")) return null;
+    ASBase e = os.getProperty("embed");
+    if (!(e instanceof EmbeddedExperience)) {
+      e = e.as(EmbeddedExperience.class);
+      os.setProperty("embed", e);
+    }
+    return (EmbeddedExperience) e;
+  }
+  
+  public boolean hasEmbeddedExperience() {
+    if (!has("openSocial")) return false;
+    ASBase os = getProperty("openSocial");
+    return os.has("embed");
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/ASObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.abdera2.activities.model.objects.PersonObject;
+import org.apache.abdera2.activities.model.objects.ServiceObject;
+import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
+
+/**
+ * An Activity. Represents some action that has been taken. At it's core,
+ * every Activity consists of an Actor (who performed the action), a Verb
+ * (what action was performed) and an Object (what was acted upon), and a 
+ * Target (to which the action is directed). For instance, if I said
+ * "John posted a photo to his album", the Actor is "John", the Verb is 
+ * "post", the Object is "a photo" and the Target is "his album". 
+ */
+@SuppressWarnings("unchecked")
+@Name("activity")
+public class Activity extends ASObject {
+
+  private static final long serialVersionUID = -3284781784555866672L;
+  public static final String ACTOR = "actor";
+  public static final String CONTENT = "content";
+  public static final String GENERATOR = "generator";
+  public static final String ICON = "icon";
+  public static final String ID = "id";
+  public static final String OBJECT = "object";
+  public static final String PUBLISHED = "published";
+  public static final String PROVIDER = "provider";
+  public static final String TARGET = "target";
+  public static final String TITLE = "title";
+  public static final String UPDATED = "updated";
+  public static final String URL = "url";
+  public static final String VERB = "verb";
+  
+  public enum Audience { 
+    TO, BTO, CC, BCC; 
+    String label() {
+      return name().toLowerCase();
+    }
+  };
+  
+  public Activity() {}
+  
+  public Activity(
+    ASObject actor, 
+    Verb verb) {
+      setActor(actor);
+      setVerb(verb);
+  }
+  
+  public Activity(
+    ASObject actor, 
+    Verb verb, 
+    ASObject object) {
+      setActor(actor);
+      setVerb(verb);
+      setObject(object);
+  }
+  
+  public Activity(
+    ASObject actor, 
+    Verb verb, 
+    ASObject object, 
+    ASObject target) {
+      setActor(actor);
+      setVerb(verb);
+      setObject(object);
+      setTarget(target);
+  }
+  
+  public ASObject getActor() {
+    return getProperty(ACTOR);
+  }
+  
+  public <E extends ASObject>E getActor(boolean create) {
+    ASObject obj = getActor();
+    if (obj == null && create) {
+      obj = new PersonObject();
+      setActor(obj);
+    }
+    return (E)obj;
+  }
+  
+  public void setActor(ASObject actor) {
+    setProperty(ACTOR, actor);
+  }
+  
+  public <E extends ASObject>E setActor(String displayName) {
+    ASObject obj = getActor(true);
+    obj.setDisplayName(displayName);
+    return (E)obj;
+  }
+  
+  public String getContent() {
+    return getProperty(CONTENT);
+  }
+  
+  public void setContent(String content) {
+    setProperty(CONTENT, content);
+  }
+  
+  public <E extends ASObject>E getGenerator() {
+    return (E)getProperty(GENERATOR);
+  }
+  
+  public <E extends ASObject>E getGenerator(boolean create) {
+    ASObject obj = getGenerator();
+    if (obj == null && create) {
+      obj = new ServiceObject();
+      setGenerator(obj);
+    }
+    return (E)obj;
+  }
+  
+  public void setGenerator(ASObject generator) {
+    setProperty(GENERATOR, generator); 
+  }
+  
+  public <E extends ASObject>E setGenerator(String displayName) {
+    ASObject obj = getGenerator(true);
+    obj.setDisplayName(displayName);
+    return (E)obj;
+  }
+  
+  public MediaLink getIcon() {
+    return getProperty(ICON);
+  }
+  
+  public void setIcon(MediaLink icon) {
+    setProperty(ICON, icon);  
+  }
+  
+  public String getId() {
+    return getProperty(ID);
+  }
+  
+  public void setId(String id) {
+    setProperty(ID, id);
+  }
+  
+  public <E extends ASObject>E getObject() {
+    return (E)getProperty(OBJECT);
+  }
+  
+  public void setObject(ASObject object) {
+    setProperty(OBJECT, object);
+  }
+  
+  public Date getPublished() {
+    return getProperty(PUBLISHED);
+  }
+  
+  public void setPublished(Date published) {
+    setProperty(PUBLISHED, published);
+    
+  }
+  
+  public <E extends ASObject>E getProvider() {
+    return (E)getProperty(PROVIDER);
+  }
+  
+  public <E extends ASObject>E getProvider(boolean create) {
+    ASObject obj = getProvider();
+    if (obj == null && create) {
+      obj = new ServiceObject();
+      setProvider(obj);
+    }
+    return (E)obj;
+  }
+  
+  public void setProvider(ASObject provider) {
+    setProperty(PROVIDER, provider);
+  }
+  
+  public <E extends ASObject>E setProvider(String displayName) {
+    ASObject obj = getProvider(true);
+    obj.setDisplayName(displayName);
+    return (E)obj;
+  }
+  
+  public <E extends ASObject>E getTarget() {
+    return (E)getProperty(TARGET);
+  }
+  
+  public void setTarget(ASObject target) {
+    setProperty(TARGET, target);
+    
+  }
+  
+  public String getTitle() {
+    return getProperty(TITLE);
+  }
+  
+  public void setTitle(String title) {
+    setProperty(TITLE, title);
+    
+  }
+  
+  public Date getUpdated() {
+    return getProperty(UPDATED);
+  }
+  
+  public void setUpdated(Date updated) {
+    setProperty(UPDATED, updated);
+    
+  }
+  
+  public IRI getUrl() {
+    return getProperty(URL);
+  }
+  
+  public void setUrl(IRI url) {
+    setProperty(URL, url);
+  }
+  
+  public Verb getVerb() {
+    return getProperty(VERB);
+  }
+  
+  public void setVerb(Verb verb) {
+    setProperty(VERB, verb);
+  }
+
+  @Override
+  public <E extends ASObject>E getAuthor() {
+    return (E)getActor();
+  }
+  
+  public <E extends ASObject>E getAuthor(boolean create) {
+    return (E)getActor(create);
+  }
+
+  @Override
+  public void setAuthor(ASObject author) {
+    setActor(author); 
+  }
+  
+  public <E extends ASObject>E setAuthor(String displayName) {
+    return (E)setActor(displayName);
+  }
+
+  @Override
+  public String getDisplayName() {
+    return getTitle();
+  }
+
+  @Override
+  public void setDisplayName(String displayName) {
+    setTitle(displayName);
+  }
+
+  @Override
+  public MediaLink getImage() {
+    return getIcon();
+  }
+
+  @Override
+  public void setImage(MediaLink image) {
+    setIcon(image);
+  }
+  
+  public Iterable<ASObject> getAudience(Audience audience) {
+    return getProperty(audience.label());
+  }
+  
+  public void setAudience(Audience audience, Set<ASObject> set) {
+    setProperty(audience.label(), set);
+  }
+  
+  public void addAudience(Audience audience, ASObject... objs) {
+    Set<ASObject> list = getProperty(audience.label());
+    if (list == null) {
+      list = new HashSet<ASObject>();
+      setProperty(audience.label(),list);
+    }
+    for (ASObject obj : objs)
+      list.add(obj);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Activity.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.apache.abdera2.common.anno.Name;
+import org.apache.abdera2.common.iri.IRI;
+
+@Name("collection")
+public class Collection<T extends ASObject> extends ASObject {
+
+  private static final long serialVersionUID = 1530068180553259077L;
+  public static final String TOTAL_ITEMS = "totalItems";
+  public static final String URL = "url";
+  public static final String ITEMS = "items";
+  public static final String OBJECT_TYPES = "objectTypes";
+
+  public int getTotalItems() {
+    return (Integer)getProperty(TOTAL_ITEMS);
+  }
+  
+  public Collection<T> setTotalItems(int totalItems) {
+    setProperty(TOTAL_ITEMS, totalItems);
+    return this;
+  }
+  
+  public IRI getUrl() {
+    return getProperty(URL);
+  }
+  
+  public void setUrl(IRI url) {
+    setProperty(URL, url);
+  }
+
+  public Iterable<String> getObjectTypes() {
+    return getProperty(OBJECT_TYPES);
+  }
+  
+  public void setObjectTypes(Set<String> types) {
+    setProperty(OBJECT_TYPES,types);
+  }
+  
+  public void addObjectType(String... objectTypes) {
+    Set<String> list = getProperty(OBJECT_TYPES);
+    if (list == null) {
+      list = new LinkedHashSet<String>();
+      setProperty(OBJECT_TYPES, list);
+    }
+    for (String objectType : objectTypes)
+      list.add(objectType);
+  }
+  
+  public Iterable<T> getItems() {
+    return getProperty(ITEMS);
+  }
+  
+  public void setItems(Set<T> items) {
+    setProperty(ITEMS, new LinkedHashSet<T>(items));
+    setTotalItems(items.size());
+  }
+  
+  public void addItem(T item) {
+    Set<T> list = getProperty(ITEMS);
+    if (list == null) {
+      list = new LinkedHashSet<T>();
+      setProperty(ITEMS, list);
+    }
+    list.add(item);
+    setTotalItems(list.size());
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Collection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/CollectionWriter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/CollectionWriter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/CollectionWriter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/CollectionWriter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,11 @@
+package org.apache.abdera2.activities.model;
+
+public interface CollectionWriter {
+
+  void writeHeader(ASBase base);
+  
+  void writeObject(ASObject object);
+  
+  void complete();
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/CollectionWriter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,61 @@
+package org.apache.abdera2.activities.model;
+
+import java.util.Map;
+
+import org.apache.abdera2.common.iri.IRI;
+
+public class EmbeddedExperience 
+  extends ASBase {
+
+  private static final long serialVersionUID = -4311572934016006379L;
+
+  public EmbeddedExperience() {}
+  
+  public IRI getUrl() {
+    return getProperty("url");
+  }
+  
+  public void setUrl(IRI iri) {
+    setProperty("url", iri);
+  }
+  
+  public void setUrl(String iri) {
+    setUrl(new IRI(iri));
+  }
+  
+  public IRI getGadget() {
+    return getProperty("gadget");
+  }
+  
+  public void setGadget(IRI iri) {
+    setProperty("gadget", iri);
+  }
+  
+  public void setGadget(String iri) {
+    setGadget(new IRI(iri));
+  }
+  
+  public ASBase getContext() {
+    return getProperty("context");
+  }
+  
+  public void setContext(ASBase context) {
+    setProperty("context", context);
+  }
+  
+  public void setContext(Map<String,Object> context) {
+    setProperty("context", context);
+  }
+  
+  public IRI getPreviewImage() {
+    return getProperty("previewImage");
+  }
+  
+  public void setPreviewImage(IRI iri) {
+    setProperty("previewImage", iri);
+  }
+  
+  public void setPreviewImage(String iri) {
+    setGadget(new IRI(iri));
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/EmbeddedExperience.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,74 @@
+package org.apache.abdera2.activities.model;
+
+/**
+ * The Generator is used to create instances of specific
+ * types of Activity Objects. They are typically best 
+ * used when generating multiple objects from a single
+ * base template, for instance, when producing multiple
+ * activity objects that share a base common set of 
+ * properties (e.g. same actor, same provider, same verb, etc)
+ */
+public class Generator<T extends ASBase> {
+
+  private final ASBase template;
+  private final Class<T> _class;
+  
+  private T item;
+  
+  public Generator(Class<T> _class) {
+    this(_class,null);
+  }
+  
+  public Generator(Class<T> _class, ASBase template) {
+    this._class = _class;
+    this.template = template;
+  }
+  
+  public Generator<T> startNew() {
+    if (item != null) 
+      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);
+      }
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+    return this;
+  }
+  
+  public Generator<T> set(String name, Object value) {
+    if (item == null)
+      throw new IllegalStateException();
+    item.setProperty(name,value);
+    return this;
+  }
+  
+  public T complete() {
+    T t = item;
+    item = null;
+    return t;
+  }
+  
+  public static interface Copyable {
+    Object copy();
+  }
+  
+  public static Generator<Activity> activityGenerator() {
+    return new Generator<Activity>(Activity.class);
+  }
+  
+  public static Generator<MediaLink> mediaLinkGenerator() {
+    return new Generator<MediaLink>(MediaLink.class);
+  }
+  
+  public static Generator<ASObject> objectGenerator() {
+    return new Generator<ASObject>(ASObject.class);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Generator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
+
+import org.apache.abdera2.common.Discover;
+import org.apache.abdera2.common.anno.AnnoUtil;
+import org.apache.abdera2.common.anno.DefaultImplementation;
+
+/**
+ * Primary interface for serializing/deserializing Activity objects. 
+ * Instances of IO are threadsafe. 
+ */
+@DefaultImplementation("org.apache.abdera2.activities.io.gson.GsonIO")
+public abstract class IO {
+
+  protected boolean autoclose = false;
+  protected String defcharset = "UTF-8";
+  
+  /**
+   * True if streams and writers should be automatically closed when
+   * the IO instance is done with them. Applies to both reads and writes
+   */
+  public void setAutoClose(boolean autoclose) {
+    this.autoclose = true;
+  }
+  
+  public boolean getAutoClose() {
+    return autoclose;
+  }
+  
+  /**
+   * Adds a mapping of a property name to a specific value class. The 
+   * serializer/deserializer will use this to select the appropriate 
+   * type adapter for the property.
+   */
+  public abstract void addPropertyMapping(String name, Class<?> _class);
+  
+  /**
+   * Registers an appropriate objectType mapping for the object. This is
+   * used to automatically select an appropriate class for individual 
+   * "objectType" values.
+   */
+  public abstract void addObjectMapping(Class<? extends ASObject>... _class);
+  
+  public void setDefaultCharset(String charset) {
+    this.defcharset = charset!=null?charset:"UTF-8";
+  }
+  
+  public String getDefaultCharset() {
+    return defcharset;
+  }
+  
+  public String write(
+    ASBase base) {
+    StringBuilder buf = 
+      new StringBuilder();
+    write(base, buf);
+    return buf.toString();
+  }
+  
+  public abstract void write(
+    ASBase base, 
+    Appendable writer);
+  
+  public void write(ASBase base, OutputStream out) {
+    write(base,out,null);
+  }
+  
+  public void write(ASBase base, OutputStream out, String charset) {
+    try {
+      OutputStreamWriter writer = 
+        new OutputStreamWriter(
+          out,charset!=null?charset:defcharset);
+      write(base,writer);
+      writer.flush();
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  
+  public <T extends ASBase>T read(InputStream in, String charset) {
+    try {
+      return read(new InputStreamReader(in,charset));
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  public Activity readActivity(InputStream in, String charset) {
+    try {
+      return readActivity(new InputStreamReader(in,charset));
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  public <T extends ASObject>Collection<T> readCollection(InputStream in, String charset) {
+    try {
+      return readCollection(new InputStreamReader(in,charset));
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  public <T extends ASObject> T readObject(InputStream in, String charset) {
+    try {
+      return readObject(new InputStreamReader(in,charset));
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  public MediaLink readMediaLink(InputStream in, String charset) {
+    try {
+      return readMediaLink(new InputStreamReader(in,charset));
+    } catch (Throwable t) {
+      throw new RuntimeException(t);
+    }
+  }
+  public abstract <T extends ASBase>T read(Reader reader);
+  public abstract <T extends ASBase>T read(String json);
+  public abstract Activity readActivity(Reader reader);
+  public abstract Activity readActivity(String json);
+  public abstract <T extends ASObject>Collection<T> readCollection(Reader reader);
+  public abstract <T extends ASObject>Collection<T> readCollection(String json);
+  public abstract <T extends ASObject>T readObject(Reader reader);
+  public abstract <T extends ASObject>T readObject(String json);
+  public abstract MediaLink readMediaLink(Reader reader);
+  public abstract MediaLink readMediaLink(String json);
+  
+  public static IO get(TypeAdapter<?>... adapters) {    
+    String defaultImpl = 
+      AnnoUtil.getDefaultImplementation(IO.class);
+    return Discover.locate(
+        IO.class, 
+        defaultImpl, 
+        (Object)adapters);  
+  }
+  
+  public void writeCollection(
+    OutputStream out, 
+    String charset,
+    ASBase header,
+    Iterable<ASObject> objects) {
+    try {
+      OutputStreamWriter outw = 
+        new OutputStreamWriter(out,charset);
+      writeCollection(outw,header,objects);
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+  
+  public abstract void writeCollection(
+    Writer out,
+    ASBase header,
+    Iterable<ASObject> objects);
+  
+  public CollectionWriter getCollectionWriter(OutputStream out, String charset) {
+    try {
+      return getCollectionWriter(new OutputStreamWriter(out,charset));
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+  }
+  
+  public abstract CollectionWriter getCollectionWriter(Writer out);
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/IO.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import org.apache.abdera2.common.iri.IRI;
+
+public class MediaLink extends ASBase {
+
+  private static final long serialVersionUID = -2003166656259290419L;
+  public static final String DURATION = "duration";
+  public static final String HEIGHT = "height";
+  public static final String WIDTH = "width";
+  public static final String URL = "url";
+  
+  public MediaLink() {}
+  
+  public MediaLink(IRI url) {
+    setUrl(url);
+  }
+  
+  public MediaLink(
+    IRI url, 
+    int height, 
+    int width, 
+    int duration) {
+      setUrl(url);
+      setHeight(height);
+      setWidth(width);
+      setDuration(duration);
+  }
+  
+  public int getDuration() {
+    return (Integer)getProperty(DURATION);
+  }
+  
+  public void setDuration(int duration) {
+    setProperty(DURATION, duration < 0 ? null : duration);
+  }
+  
+  public int getHeight() {
+    return (Integer)getProperty(HEIGHT);
+  }
+  
+  public void setHeight(int height) {
+    setProperty(HEIGHT, height < 0 ? null : height);
+  }
+  
+  public int getWidth() {
+    return (Integer)getProperty(WIDTH);
+  }
+  
+  public void setWidth(int width) {
+    setProperty(WIDTH, width < 0 ? null : width);
+  }
+  
+  public IRI getUrl() {
+    return getProperty(URL);
+  }
+  
+  public void setUrl(IRI url) {
+    setProperty(URL, url);
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/MediaLink.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/TypeAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/TypeAdapter.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/TypeAdapter.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/TypeAdapter.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+public interface TypeAdapter<T> {
+
+  Class<T> getAdaptedClass();
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/TypeAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java?rev=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public abstract class Verb {
+
+ private static final Map<String,Verb> VERBS = 
+   new ConcurrentHashMap<String,Verb>();
+  
+ public static synchronized final Verb get(String name) {
+   return VERBS.containsKey(name) ? 
+       VERBS.get(name) : 
+       new Verb(name) {};
+ }
+ 
+ public static final Verb ADD = new Verb("add") {};
+ public static final Verb CANCEL = new Verb("cancel") {};
+ public static final Verb CHECKIN = new Verb("checkin") {};
+ public static final Verb DELETE = new Verb("delete") {};
+ public static final Verb FAVORITE = new Verb("favorite") {};
+ public static final Verb FOLLOW = new Verb("follow") {};
+ public static final Verb GIVE = new Verb("give") {};
+ public static final Verb IGNORE = new Verb("ignore") {};
+ public static final Verb INVITE = new Verb("invite") {};
+ public static final Verb JOIN = new Verb("join") {};
+ public static final Verb LEAVE = new Verb("leave") {};
+ public static final Verb LIKE = new Verb("like") {};
+ public static final Verb MAKE_FRIEND = new Verb("make-friend") {};
+ public static final Verb POST = new Verb("post") {};
+ public static final Verb PLAY = new Verb("play") {};
+ public static final Verb RECEIVE = new Verb("receive") {};
+ public static final Verb REMOVE = new Verb("remove") {};
+ public static final Verb REMOVE_FRIEND = new Verb("remove-friend") {};
+ public static final Verb REQUEST_FRIEND = new Verb("request-friend") {};
+ public static final Verb RSVP_MAYBE = new Verb("rsvp-maybe") {};
+ public static final Verb RSVP_NO = new Verb("rsvp-no") {};
+ public static final Verb RSVP_YES = new Verb("rsvp-yes") {};
+ public static final Verb SAVE = new Verb("save") {};
+ public static final Verb SHARE = new Verb("share") {};
+ public static final Verb STOP_FOLLOWING = new Verb("stop-following") {};
+ public static final Verb TAG = new Verb("tag") {};
+ public static final Verb UNFAVORITE = new Verb("unfavorite") {};
+ public static final Verb UNLIKE = new Verb("unlike") {};
+ public static final Verb UNSAVE = new Verb("unsave") {};
+ public static final Verb UPDATE = new Verb("update") {};
+ 
+ // As in "Sally purchased the app"
+ public static final Verb PURCHASED = new Verb("purchase") {};
+ 
+ // As in: "Joe is hosting a meeting"
+ public static final Verb HOST = new Verb("host") {};
+ 
+ // As in: "Mark read the book" ... this is related to "play", but saying that
+ // someone "played" a book just doesn't make much sense. A user can 
+ // "play" and audio book, but they must "read" the physical or ebook,
+ // also works for "Mark read the note", "Sally read the question", etc
+ public static final Verb READ = new Verb("read") {};
+ 
+ 
+ private final String name;
+  
+  public Verb(String name) {
+    this.name = name;
+    VERBS.put(name,this);
+  }
+  
+  public String getName() {
+    return name;
+  }
+  
+  public String toString() {
+    return name;
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((name == null) ? 0 : name.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null)
+      return false;
+    if (getClass() != obj.getClass())
+      return false;
+    Verb other = (Verb) obj;
+    if (name == null) {
+      if (other.name != null)
+        return false;
+    } else if (!name.equals(other.name))
+      return false;
+    return true;
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/Verb.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,42 @@
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.common.anno.Name;
+
+@Name("account")
+public class AccountObject 
+  extends ServiceObject {
+
+  private static final long serialVersionUID = 1058258637558799759L;
+
+  public AccountObject() {
+    super();
+  }
+
+  public AccountObject(String displayName) {
+    super(displayName);
+  }
+
+  public String getDomain() {
+    return getProperty("domain");
+  }
+  
+  public void setDomain(String domain) {
+    setProperty("domain", domain);
+  }
+  
+  public String getUsername() {
+    return getProperty("username");
+  }
+  
+  public void setUsername(String username) {
+    setProperty("username", username);
+  }
+  
+  public String getUserId() {
+    return getProperty("userId");
+  }
+  
+  public void setUserId(String userid) {
+    setProperty("userId", userid);
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AccountObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("address")
+public class Address extends ASObject {
+
+  private static final long serialVersionUID = -6352046844998504401L;
+  public static final String FORMATTED = "formatted";
+  public static final String STREETADDRESS = "streetAddress";
+  public static final String LOCALITY = "locality";
+  public static final String REGION = "region";
+  public static final String POSTALCODE = "postalCode";
+  public static final String COUNTRY = "country";
+  
+  public String getFormatted() {
+    return getProperty(FORMATTED);
+  }
+  
+  public void setFormatted(String formatted) {
+    setProperty(FORMATTED, formatted);
+  }
+  
+  public String getStreetAddress() {
+    return getProperty(STREETADDRESS);
+  }
+  
+  public void setStreetAddress(String streetAddress) {
+    setProperty(STREETADDRESS, streetAddress);
+  }
+  
+  public String getLocality() {
+    return getProperty(LOCALITY);
+  }
+  
+  public void setLocality(String locality) {
+    setProperty(LOCALITY, locality);
+  }
+  
+  public String getRegion() {
+    return getProperty(REGION);
+  }
+  
+  public void setRegion(String region) {
+    setProperty(REGION, region);
+  }
+  
+  public String getPostalCode() {
+    return getProperty(POSTALCODE);
+  }
+  
+  public void setPostalCode(String postalCode) {
+    setProperty(POSTALCODE, postalCode);
+  }
+  
+  public String getCountry() {
+    return getProperty(COUNTRY);
+  }
+  
+  public void setCountry(String country) {
+    setProperty(COUNTRY, country);
+  }
+  
+  public String toString() {
+    StringBuilder buf = new StringBuilder();
+    if (getFormatted() != null) {
+      buf.append(getFormatted());
+    } else {
+      buf.append("an address");
+    }
+    return buf.toString();
+  }
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/Address.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("article")
+public class ArticleObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -9127545085992655433L;
+  
+  public ArticleObject() {}
+  
+  public ArticleObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/ArticleObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.activities.model.MediaLink;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("audio")
+public class AudioObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = 3686825866815403406L;
+  public static final String EMBEDCODE = "embedCode";
+  public static final String STREAM = "stream";
+  
+  public AudioObject() { }
+  
+  public AudioObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public String getEmbedCode() {
+    return getProperty(EMBEDCODE);
+  }
+  
+  public void setEmbedCode(String embedCode) {
+    setProperty(EMBEDCODE, embedCode);
+  }
+  
+  public MediaLink getStream() {
+    return getProperty(STREAM);
+  }
+  
+  public void setStream(MediaLink stream) {
+    setProperty(STREAM, stream);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/AudioObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("badge")
+public class BadgeObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -3928700532413017490L;
+  
+  public BadgeObject() {}
+  
+  public BadgeObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BadgeObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("bookmark")
+public class BookmarkObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -2753772783838463022L;
+  public static final String TARGETURL = "targetUrl";
+  
+  public BookmarkObject() {}
+  
+  public BookmarkObject(String displayName) {
+    setDisplayName(displayName);
+  }
+  
+  public String getTargetUrl() {
+    return getProperty(TARGETURL);
+  }
+  
+  public void setTargetUrl(String targetUrl) {
+    setProperty(TARGETURL, targetUrl);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/BookmarkObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: 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=1173209&view=auto
==============================================================================
--- abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java (added)
+++ abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java Tue Sep 20 15:56:46 2011
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
+ */
+package org.apache.abdera2.activities.model.objects;
+
+import org.apache.abdera2.activities.model.ASObject;
+import org.apache.abdera2.common.anno.Name;
+
+@Name("comment")
+public class CommentObject 
+  extends ASObject {
+
+  private static final long serialVersionUID = -7911420073285087386L;
+  
+  public CommentObject() {}
+  
+  public CommentObject(String displayName) {
+    setDisplayName(displayName);
+  }
+
+}

Propchange: abdera/abdera2/activities/src/main/java/org/apache/abdera2/activities/model/objects/CommentObject.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message