org.apache.abdera.factory.Factory.newContent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(119)

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

Factory.newContent介绍

[英]Create a new Content element.
[中]创建一个新的内容元素。

代码示例

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

protected void setEntryContent(Factory factory, Entry e, String content) {
  Content ct = factory.newContent(Content.Type.XML);
  ct.setValue(content);
  e.setContentElement(ct);
}

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

protected void setEntryContent(Factory factory, Entry e, String content) {
  Content ct = factory.newContent(Content.Type.XML);
  ct.setValue(content);
  e.setContentElement(ct);
}

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

protected void setEntryContent(Factory factory, Entry e, String content) {
  Content ct = factory.newContent(Content.Type.XML);
  ct.setValue(content);
  e.setContentElement(ct);
}

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

private Entry createBookEntry(int id, String name) throws Exception {
  Book b = new Book();
  b.setId(id);
  b.setName(name);
  Factory factory = Abdera.getNewFactory();
  JAXBContext jc = JAXBContext.newInstance(Book.class);
  Entry e = factory.getAbdera().newEntry();
  e.setTitle(b.getName());
  e.setId(Long.toString(b.getId()));
  StringWriter writer = new StringWriter();
  jc.createMarshaller().marshal(b, writer);
  Content ct = factory.newContent(Content.Type.XML);
  ct.setValue(writer.toString());
  e.setContentElement(ct);
  return e;
}

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

Content content = factory.newContent();
content.setContentType(Content.Type.XML);
content.setValue(value);

代码示例来源:origin: org.xcmis/xcmis-restatom

Content content = factory.newContent();
content.setContentType(null);
content.setSrc(contentLink);

相关文章