abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r590503 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ core/src/test/java/org/apache/abdera/test/core/ parser/src/main/java/org/apache/abdera/parser/stax/
Date Tue, 30 Oct 2007 23:01:18 GMT
Author: jmsnell
Date: Tue Oct 30 16:01:16 2007
New Revision: 590503

URL: http://svn.apache.org/viewvc?rev=590503&view=rev
Log:
Helper methods that make it easier to use registered namedwriters, e.g.,

Abdera abdera = Abdera.getInstance();
Entry entry = abdera.newEntry();
entry.writeTo("json", System.out);

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Base.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
    incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Base.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Base.java?rev=590503&r1=590502&r2=590503&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Base.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Base.java Tue Oct
30 16:01:16 2007
@@ -68,6 +68,21 @@
    * @param out The target output writer
    */
   void writeTo(org.apache.abdera.writer.Writer writer, Writer out) throws IOException;
+
+  /**
+   * Serializes the model component out to the specified stream using the given Abdera writer
+   * @param writer The Abdera writer to use
+   * @param out The target output stream
+   */
+  void writeTo(String writer, OutputStream out) throws IOException;
+  
+  /**
+   * Serializes the model component out to the specified java.io.Writer using the 
+   * given Abdera writer
+   * @param writer The Abdera writer to use
+   * @param out The target output writer
+   */
+  void writeTo(String writer, Writer out) throws IOException;
   
   /**
    * Serializes the model component out to the specified stream using the 
@@ -86,6 +101,24 @@
    * @param options The WriterOptions to use
    */
   void writeTo(org.apache.abdera.writer.Writer writer, Writer out, WriterOptions options)
throws IOException;
+
+  /**
+   * Serializes the model component out to the specified stream using the 
+   * given abdera writer
+   * @param writer The name of the Abdera writer to use
+   * @param out The target output stream
+   * @param options The WriterOptions to use
+   */
+  void writeTo(String writer, OutputStream out, WriterOptions options) throws IOException;
+  
+  /**
+   * Serializes the model component out to the specified java.io.Writer using the 
+   * given abdera writer
+   * @param writer The name of the Abdera writer to use
+   * @param out The target output writer
+   * @param options The WriterOptions to use
+   */
+  void writeTo(String writer, Writer out, WriterOptions options) throws IOException;
   
   /**
    * Serializes the model component out to the specified stream

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java?rev=590503&r1=590502&r2=590503&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/ElementWrapper.java
Tue Oct 30 16:01:16 2007
@@ -262,6 +262,22 @@
     internal.writeTo(writer,out);
   }
 
+  public void writeTo(String writer, OutputStream out, WriterOptions options) throws IOException
{
+    internal.writeTo(writer,out,options);
+  }
+
+  public void writeTo(String writer, OutputStream out) throws IOException {
+    internal.writeTo(writer,out);
+  }
+
+  public void writeTo(String writer, Writer out, WriterOptions options) throws IOException
{
+    internal.writeTo(writer,out,options);
+  }
+
+  public void writeTo(String writer, Writer out) throws IOException {
+    internal.writeTo(writer,out);
+  }
+  
   public void writeTo(Writer out, WriterOptions options) throws IOException {
     internal.writeTo(out,options);
   }

Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?rev=590503&r1=590502&r2=590503&view=diff
==============================================================================
--- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
(original)
+++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
Tue Oct 30 16:01:16 2007
@@ -733,6 +733,16 @@
     public Iterator<Element> iterator() {
       return null;
     }
+
+    public void writeTo(String writer, OutputStream out) throws IOException {}
+
+    public void writeTo(String writer, Writer out) throws IOException {}
+
+    public void writeTo(String writer, OutputStream out, WriterOptions options)
+        throws IOException {}
+
+    public void writeTo(String writer, Writer out, WriterOptions options)
+        throws IOException {}
     
   }
   
@@ -1388,6 +1398,16 @@
     public Iterator<Element> iterator() {
       return null;
     }
+
+    public void writeTo(String writer, OutputStream out) throws IOException {}
+
+    public void writeTo(String writer, Writer out) throws IOException {}
+
+    public void writeTo(String writer, OutputStream out, WriterOptions options)
+        throws IOException {}
+
+    public void writeTo(String writer, Writer out, WriterOptions options)
+        throws IOException {}
     
   }
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java?rev=590503&r1=590502&r2=590503&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
Tue Oct 30 16:01:16 2007
@@ -353,4 +353,34 @@
   public void complete() {
     if (!isComplete() && getRoot() != null) getRoot().complete();
   }
+
+  public void writeTo(
+    String writer, 
+    OutputStream out) 
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out);
+  }
+
+  public void writeTo(
+    String writer, 
+    java.io.Writer out) 
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out);
+  }
+
+  public void writeTo(
+    String writer, 
+    OutputStream out, 
+    WriterOptions options)
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out,options);
+  }
+
+  public void writeTo(
+    String writer, 
+    java.io.Writer out, 
+    WriterOptions options)
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out,options);
+  }
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=590503&r1=590502&r2=590503&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Tue Oct 30 16:01:16 2007
@@ -825,4 +825,33 @@
     return getElements().iterator();
   }
 
+  public void writeTo(
+    String writer, 
+    OutputStream out) 
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out);
+  }
+
+  public void writeTo(
+    String writer, 
+    java.io.Writer out) 
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out);
+  }
+
+  public void writeTo(
+    String writer, 
+    OutputStream out, 
+    WriterOptions options)
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out,options);
+  }
+
+  public void writeTo(
+    String writer, 
+    java.io.Writer out, 
+    WriterOptions options)
+      throws IOException {
+    writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer),out,options);
+  }
 }



Mime
View raw message