Examples of newStreamWriter()


Examples of org.apache.abdera.Abdera.newStreamWriter()

    static Calendar cal_now = Calendar.getInstance();

    @Test
    public void testSimple() throws Exception {
        Abdera abdera = Abdera.getInstance();
        StreamWriter sw = abdera.newStreamWriter();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        sw.setOutputStream(out).setAutoIndent(true);
        ConventionSerializationContext c = new ConventionSerializationContext(sw);
        c.setSerializer(MyEntry.class, new EntrySerializer());
        sw.startDocument();
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

    }

    @Test
    public void testAnnotated() throws Exception {
        Abdera abdera = Abdera.getInstance();
        StreamWriter sw = abdera.newStreamWriter();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        sw.setOutputStream(out).setAutoIndent(true);
        ConventionSerializationContext c = new ConventionSerializationContext(sw);
        sw.startDocument();
        c.serialize(new MyAnnotatedEntry());
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

    public static void main(String... args) {

        Abdera abdera = Abdera.getInstance();

        StreamWriter out =
            abdera.newStreamWriter().setOutputStream(System.out, "UTF-8").setAutoflush(false).setAutoIndent(true)
                .startDocument().startFeed().writeBase("http://example.org").writeLanguage("en-US")
                .writeId("http://example.org").writeTitle("<Testing 123>").writeSubtitle("Foo").writeAuthor("James",
                                                                                                            null,
                                                                                                            null)
                .writeUpdated(new Date()).writeLink("http://example.org/foo").writeLink("http://example.org/bar",
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

    public static void main(String... args) throws Exception {

        Abdera abdera = Abdera.getInstance();

        // demonstrate serialization of a non-annotated java object
        StreamWriter sw = abdera.newStreamWriter();
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        sw.setOutputStream(out).setAutoIndent(true);
        ConventionSerializationContext c = new ConventionSerializationContext(sw);
        c.setSerializer(MyEntry.class, new EntrySerializer());
        sw.startDocument();
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

        System.out.println();

        // demonstrate serialization using an annotated java object
        // annotations allow the developer to customize the way the
        // object is serialized
        sw = abdera.newStreamWriter();
        out = new ByteArrayOutputStream();
        sw.setOutputStream(out).setAutoIndent(true);
        c = new ConventionSerializationContext(sw);
        sw.startDocument();
        c.serialize(new MyAnnotatedEntry());
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

*/
public class EntityProviderExample {

    public static void main(String... args) throws Exception {
        Abdera abdera = Abdera.getInstance();
        StreamWriter sw = abdera.newStreamWriter().setOutputStream(System.out).setAutoIndent(true);
        Foo foo = new Foo();
        foo.writeTo(sw);
        sw.close();
    }

View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

public class AtomLinkTemplate {

    public static void main(String... args) throws Exception {

        Abdera abdera = Abdera.getInstance();
        abdera.newStreamWriter().setOutputStream(System.out).startDocument().startFeed()
            .writeBase("http://example.org").writeLink(getPage("entries", 1, 10), "current")
            .writeLink(getPage("entries", 2, 10), "self").writeLink(getPage("entries", 1, 10), "previous")
            .writeLink(getPage("entries", 3, 10), "next").writeLink(getPage("entries", 1, 10), "first")
            .writeLink(getPage("entries", 10, 10), "last").endFeed().endDocument().flush();
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

  public static void main(String... args) throws Exception {
   
    Abdera abdera = Abdera.getInstance();
   
    // demonstrate serialization of a non-annotated java object
    StreamWriter sw = abdera.newStreamWriter();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    sw.setOutputStream(out)
      .setAutoIndent(true);
    ConventionSerializationContext c =
      new ConventionSerializationContext(sw);
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

    System.out.println();
   
    // demonstrate serialization using an annotated java object
    // annotations allow the developer to customize the way the
    // object is serialized
    sw = abdera.newStreamWriter();
    out = new ByteArrayOutputStream();
    sw.setOutputStream(out)
      .setAutoIndent(true);
    c = new ConventionSerializationContext(sw);
    sw.startDocument();
View Full Code Here

Examples of org.apache.abdera.Abdera.newStreamWriter()

  static Calendar cal_now = Calendar.getInstance();
 
  @Test
  public void testSimple() throws Exception {
    Abdera abdera = Abdera.getInstance();
    StreamWriter sw = abdera.newStreamWriter();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    sw.setOutputStream(out)
      .setAutoIndent(true);
    ConventionSerializationContext c =
      new ConventionSerializationContext(sw);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.