Package org.apache.abdera.writer

Examples of org.apache.abdera.writer.WriterFactory


* @version $Rev: 823050 $ $Date: 2009-10-07 23:05:32 -0700 (Wed, 07 Oct 2009) $
*/
public class AtomTestCaseUtils {

    public static void prettyPrint(Abdera abdera, Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here


    assertEquals(404, res.getStatus());
    res.release();
  }

  protected void prettyPrint(Abdera abdera, Base doc) throws IOException {
     WriterFactory factory = abdera.getWriterFactory();
     Writer writer = factory.getWriter("prettyxml");
     writer.writeTo(doc, System.out);
     System.out.println();
  }
View Full Code Here

  public static void tearDown() throws Exception {
    server.stop();
  }

  protected void prettyPrint(Base doc) throws IOException {
    WriterFactory factory = abdera.getWriterFactory();
    Writer writer = factory.getWriter("prettyxml");
    writer.writeTo(doc, System.out);
    System.out.println();
  }
View Full Code Here

    }

    /** Pretty print the document body. */
    public static void prettyPrint(Abdera abdera, Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here

    }

    /** Pretty print the document body. */
    public static void prettyPrint(Abdera abdera, Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here

    public static void tearDown() throws Exception {
        server.stop();
    }

    protected void prettyPrint(Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here

        assertEquals(404, res.getStatus());
        res.release();
    }

    protected void prettyPrint(Abdera abdera, Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here

    public static void tearDown() throws Exception {
        server.stop();
    }

    protected void prettyPrint(Base doc) throws IOException {
        WriterFactory factory = abdera.getWriterFactory();
        Writer writer = factory.getWriter("prettyxml");
        writer.writeTo(doc, System.out);
        System.out.println();
    }
View Full Code Here

     * PrettyXML writer, or any other writer that supports any writer that supports a specific form of "application/*".
     * It's always best to be very specific in the Accept headers.
     */
    public static NamedWriter getAcceptableNamedWriter(Abdera abdera, String accept_header) {
        String[] sorted_accepts = orderByQ(accept_header);
        WriterFactory factory = abdera.getWriterFactory();
        if (factory == null)
            return null;
        for (String accept : sorted_accepts) {
            NamedWriter writer = (NamedWriter)factory.getWriterByMediaType(accept);
            if (writer != null)
                return writer;
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }

    public static NamedWriter getNamedWriter(Abdera abdera, String mediatype) {
        WriterFactory factory = abdera.getWriterFactory();
        if (factory == null)
            return null;
        NamedWriter writer = (NamedWriter)factory.getWriterByMediaType(mediatype);
        return writer;
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.writer.WriterFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.