Package org.apache.abdera.writer

Examples of org.apache.abdera.writer.Writer


  public void writeTo(
    OutputStream out,
    WriterOptions options)
      throws IOException {
    Writer writer = this.getFactory().getAbdera().getWriter();
    writer.writeTo(this,out,options);
  }
View Full Code Here


 
  public void writeTo(
    java.io.Writer out,
    WriterOptions options)
      throws IOException {
    Writer writer = this.getFactory().getAbdera().getWriter();
    writer.writeTo(this,out,options);
  }
View Full Code Here

  }
 
  public void writeTo(OutputStream out) throws IOException {
    String charset = getCharset();
    if (charset == null) charset = "UTF-8";
    Writer writer = getFactory().getAbdera().getWriter();
    writeTo(writer,new OutputStreamWriter(out, charset));
  }
View Full Code Here

    Writer writer = getFactory().getAbdera().getWriter();
    writeTo(writer,new OutputStreamWriter(out, charset));
  }

  public void writeTo(java.io.Writer writer) throws IOException {
    Writer out = getFactory().getAbdera().getWriter();
    if (!(out instanceof FOMWriter)) {
      out.writeTo(this,writer);
    } else {
      try {     
        OMOutputFormat outputFormat = new OMOutputFormat();
        if (this.getCharsetEncoding() != null)
          outputFormat.setCharSetEncoding(this.getCharsetEncoding());
View Full Code Here

  public void writeTo(
    OutputStream out,
    WriterOptions options)
      throws IOException {
    Writer writer = this.getFactory().getAbdera().getWriter();
    writer.writeTo(this,out,options);
  }
View Full Code Here

 
  public void writeTo(
    java.io.Writer out,
    WriterOptions options)
      throws IOException {
    Writer writer = this.getFactory().getAbdera().getWriter();
    writer.writeTo(this,out,options);
  }
View Full Code Here

  }
 
  public void writeTo(OutputStream out) throws IOException {
    Document doc = getDocument();
    String charset = doc != null ? doc.getCharset() : "UTF-8";
    Writer writer = this.getFactory().getAbdera().getWriter();
    writeTo(writer,new OutputStreamWriter(out,charset));
  }
View Full Code Here

    Writer writer = this.getFactory().getAbdera().getWriter();
    writeTo(writer,new OutputStreamWriter(out,charset));
  }

  public void writeTo(java.io.Writer writer) throws IOException {
    Writer out = getFactory().getAbdera().getWriter();
    if (!(out instanceof FOMWriter)) {
      out.writeTo(this,writer);
    } else {
      try {
        OMOutputFormat outputFormat = new OMOutputFormat();
        if (getDocument() != null && getDocument().getCharset() != null)
          outputFormat.setCharSetEncoding(getDocument().getCharset());
View Full Code Here

*/
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

    public void writeTo(T element, Class<?> clazz, Type type, Annotation[] a,
                        MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os)
        throws IOException {
        if (MediaType.APPLICATION_JSON_TYPE.isCompatible(mt)) {
            Writer w = createWriter("json");
            if (w == null) {
                throw new NotSupportedException();
            }
            element.writeTo(w, os);  
        } else if (formattedOutput) {
            Writer w = createWriter("prettyxml");
            if (w != null) {
                element.writeTo(w, os);
            } else {
                element.writeTo(os);
            }
View Full Code Here

TOP

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

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.