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

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

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

Factory.getAbdera介绍

[英]Get the Abdera instance for this factory
[中]获取此工厂的Abdera实例

代码示例

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

private static Object[] getChildren(Element element) {
  Abdera abdera = element.getFactory().getAbdera();
  XPath xpath = abdera.getXPath();
  List<Object> nodes = xpath.selectNodes("node()", element);
  return nodes.toArray(new Object[nodes.size()]);
}

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

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

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

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

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

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

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

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

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

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

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

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

代码示例来源: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: apache/cxf

protected Entry createEntryFromObject(Factory factory, Object o, Class<?> cls) throws Exception {
  Entry entry = factory.getAbdera().newEntry();
  if (!buildEntry(entry, o, cls)) {
    setEntryProperties(factory, entry, o, cls);
  }
  if (entry.getContentElement() == null
    && entry.getExtensions().isEmpty()) {
    createEntryContent(factory, entry, o, cls);
  }
  return entry;
}

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

protected Entry createEntryFromObject(Factory factory, Object o, Class<?> cls) throws Exception {
  Entry entry = factory.getAbdera().newEntry();
  if (!buildEntry(entry, o, cls)) {
    setEntryProperties(factory, entry, o, cls);
  }
  if (entry.getContentElement() == null
    && entry.getExtensions().isEmpty()) {
    createEntryContent(factory, entry, o, cls);
  }
  return entry;
}

代码示例来源: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.cxf/cxf-bundle-jaxrs

protected Entry createEntryFromObject(Factory factory, Object o, Class<?> cls) throws Exception {
  Entry entry = factory.getAbdera().newEntry();
  
  if (!buildEntry(entry, o, cls)) {
    setEntryProperties(factory, entry, o, cls);
  }
  
  if (entry.getContentElement() == null 
    && entry.getExtensions().size() == 0) {
    createEntryContent(factory, entry, o, cls);    
  }
  return entry;

}

代码示例来源: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: 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: 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.abdera/abdera-parser

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());
      serialize(writer, outputFormat);
    } catch (XMLStreamException e) {
      throw new FOMException(e);
    }
  }
}

相关文章