gpt4 book ai didi

org.apache.abdera.writer.WriterFactory类的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 04:35:05 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.abdera.writer.WriterFactory类的一些代码示例,展示了WriterFactory类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriterFactory类的具体详情如下:
包路径:org.apache.abdera.writer.WriterFactory
类名称:WriterFactory

WriterFactory介绍

[英]The WriterFactory is used a acquire instances of alternative writers registered with Abdera.
[中]WriterFactory用于获取在Abdera注册的其他作家的实例。

代码示例

代码示例来源:origin: apache/cxf

protected Writer createWriter(String writerName) {
  Writer w = ATOM_ENGINE.getWriterFactory().getWriter(writerName);
  if (w == null) {
    LOG.fine("Atom writer \"" + writerName + "\" is not available");
  }
  return w;
}

代码示例来源:origin: org.apache.abdera/abdera-server

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;
}

代码示例来源:origin: org.apache.abdera/abdera-server

/**
 * Create a new StreamWriter instance. If the sw property was set, the specified Named StreamWriter will be returned
 */
protected StreamWriter newStreamWriter() {
  return sw == null ? abdera.newStreamWriter() : abdera.getWriterFactory().newStreamWriter(sw);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

protected Writer createWriter(String writerName) {
  Writer w = ATOM_ENGINE.getWriterFactory().getWriter(writerName);
  if (w == null) {
    LOG.fine("Atom writer \"" + writerName + "\" is not available");
  }
  return w;
}

代码示例来源:origin: org.apache.abdera/abdera-server

/**
 * Returns an appropriate NamedWriter instance given an appropriately formatted HTTP Accept header. The header will
 * be parsed and sorted according to it's q parameter values. The first named writer capable of supporting the
 * specified type, in order of q-value preference, will be returned. The results on this are not always predictable.
 * For instance, if the Accept header says "application/*" it could end up with either the JSON writer or the
 * 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;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-extension-providers

protected Writer createWriter(String writerName) {
  Writer w = ATOM_ENGINE.getWriterFactory().getWriter(writerName);
  if (w == null) {
    LOG.fine("Atom writer \"" + writerName + "\" is not available");
  }
  return w;
}

代码示例来源:origin: apache/cxf

protected Writer createWriter(String writerName) {
  return ATOM_ENGINE.getWriterFactory().getWriter(writerName);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

protected Writer createWriter(String writerName) {
  return ATOM_ENGINE.getWriterFactory().getWriter(writerName);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-extension-providers

protected Writer createWriter(String writerName) {
  return ATOM_ENGINE.getWriterFactory().getWriter(writerName);
}

代码示例来源:origin: org.fuzzydb.atom/org.fuzzydb.abdera.util

static public void prettyPrint(Document<? extends Element> doc) {
  //=== Write it prettily! ===
  Abdera abdera = Abdera.getInstance();
  try {
    Writer writer = abdera.getWriterFactory().getWriter("prettyxml");
    WriterOptions writeOptions = writer.getDefaultWriterOptions();
    writeOptions.setCharset("UTF-8");
    writer.writeTo(doc, System.out, writeOptions);
  } catch (Exception e) { e.printStackTrace(); } // FIXME: Document this exception
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, java.io.Writer out) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, OutputStream out, WriterOptions options) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out, options);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, OutputStream out) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, java.io.Writer out) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out);
}

代码示例来源:origin: com.sun.jersey.contribs/jersey-atom-abdera

public void writeTo(Categories categories, Class<?> type, Type genericType,
          Annotation[] annotations, MediaType mediaType,
          MultivaluedMap<String, Object> headers,
          OutputStream stream) throws IOException, WebApplicationException {
  if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE) || mediaType.getSubtype().endsWith("+json")) {
    Writer writer = Abdera.getInstance().getWriterFactory().getWriter("json");
    writer.writeTo(categories, stream);
  } else {
    categories.writeTo(stream);
  }
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, java.io.Writer out, WriterOptions options) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out, options);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, OutputStream out) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, OutputStream out, WriterOptions options) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out, options);
}

代码示例来源:origin: org.apache.abdera/abdera-parser

public void writeTo(String writer, java.io.Writer out, WriterOptions options) throws IOException {
  writeTo(getFactory().getAbdera().getWriterFactory().getWriter(writer), out, options);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-atom-runtime

Abdera abdera = new Abdera();
  WriterFactory wf = abdera.getWriterFactory();
  org.apache.abdera.writer.Writer json = wf.getWriter("json");
  feed.writeTo(json, response.getWriter());
} catch (Exception e) {
  Abdera abdera = new Abdera();
  WriterFactory wf = abdera.getWriterFactory();
  org.apache.abdera.writer.Writer json = wf.getWriter("json");
  feedEntry.writeTo(json, response.getWriter());
} catch (Exception e) {

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com