abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r449858 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java
Date Mon, 25 Sep 2006 23:28:29 GMT
Author: jmsnell
Date: Mon Sep 25 16:28:29 2006
New Revision: 449858

URL: http://svn.apache.org/viewvc?view=rev&rev=449858
Log:
FOMWriter needs to implement NamedWriter

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java?view=diff&rev=449858&r1=449857&r2=449858
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWriter.java
Mon Sep 25 16:28:29 2006
@@ -24,9 +24,11 @@
 
 import org.apache.abdera.Abdera;
 import org.apache.abdera.model.Base;
+import org.apache.abdera.util.Constants;
+import org.apache.abdera.util.MimeTypeHelper;
 
 public class FOMWriter 
-  implements org.apache.abdera.writer.Writer {
+  implements org.apache.abdera.writer.NamedWriter {
 
   public FOMWriter() {}
   
@@ -52,6 +54,26 @@
     ByteArrayOutputStream out = new ByteArrayOutputStream();
     writeTo(base, out);
     return out.toString();
+  }
+
+  public String getName() {
+    return "default";
+  }
+
+  public String[] getOutputFormats() {
+    return new String[] {
+      Constants.ATOM_MEDIA_TYPE,
+      Constants.APP_MEDIA_TYPE,
+      Constants.CAT_MEDIA_TYPE,
+      Constants.XML_MEDIA_TYPE
+    };
+  }
+
+  public boolean outputsFormat(String mediatype) {
+    return MimeTypeHelper.isMatch(mediatype, Constants.ATOM_MEDIA_TYPE) ||
+           MimeTypeHelper.isMatch(mediatype, Constants.APP_MEDIA_TYPE) ||
+           MimeTypeHelper.isMatch(mediatype, Constants.CAT_MEDIA_TYPE) ||
+           MimeTypeHelper.isMatch(mediatype, Constants.XML_MEDIA_TYPE);
   }
 
 }



Mime
View raw message