abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r422264 - /incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
Date Sat, 15 Jul 2006 16:45:46 GMT
Author: jmsnell
Date: Sat Jul 15 09:45:46 2006
New Revision: 422264

URL: http://svn.apache.org/viewvc?rev=422264&view=rev
Log:
Let the JSONWriter support writing out Document instances

Modified:
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java?rev=422264&r1=422263&r2=422264&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
(original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
Sat Jul 15 09:45:46 2006
@@ -26,6 +26,7 @@
 import org.apache.abdera.model.Category;
 import org.apache.abdera.model.Collection;
 import org.apache.abdera.model.Content;
+import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Generator;
@@ -79,6 +80,8 @@
       return toJSON((Entry) object);
     } else if(object instanceof Service) {
       return toJSON((Service) object);
+    } else if(object instanceof Document) {
+      return toJSON(((Document)object).getRoot());
     }
     return new IllegalArgumentException("Element is not supported by JSONWriter.");
   }



Mime
View raw message