gpt4 book ai didi

xdi2.core.io.XDIReaderRegistry.getAuto()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 09:41:05 26 4
gpt4 key购买 nike

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

XDIReaderRegistry.getAuto介绍

[英]Returns an XDIReader for auto-detecting the format.
[中]返回自动检测格式的XDIReader。

代码示例

代码示例来源:origin: projectdanube/xdi2

/**
 * Returns an XDIReader for the specified format, e.g.
 * <ul>
 * <li>XDI/JSON</li>
 * <li>XDI DISPLAY</li>
 * </ul>
 * @return An XDIReader, or null if no appropriate implementation could be found.
 */
public static XDIReader forFormat(String format, Properties parameters) {
  if (format == null) return XDIReaderRegistry.getDefault();
  if (AutoReader.FORMAT_NAME.equalsIgnoreCase(format)) return getAuto();
  Class<? extends XDIReader> readerClass = readerClassesByFormat.get(format);
  if (readerClass == null) return null;
  try {
    Constructor<? extends XDIReader> constructor = readerClass.getConstructor(Properties.class);
    return constructor.newInstance(parameters);
  } catch (Exception ex) {
    throw new RuntimeException(ex);
  }
}

代码示例来源:origin: projectdanube/xdi2

@Override
public Graph parseGraph(String string) throws IOException, Xdi2ParseException {
  Graph graph = this.openGraph();
  XDIReaderRegistry.getAuto().read(graph, new StringReader(string));
  return graph;
}

代码示例来源:origin: projectdanube/xdi2

@Override
public Graph loadGraph(Reader reader) throws IOException, Xdi2ParseException {
  Graph graph = this.openGraph();
  XDIReaderRegistry.getAuto().read(graph, reader);
  return graph;
}

代码示例来源:origin: projectdanube/xdi2

@Override
public Graph loadGraph(InputStream inputStream) throws IOException, Xdi2ParseException {
  Graph graph = this.openGraph();
  XDIReaderRegistry.getAuto().read(graph, inputStream);
  return graph;
}

代码示例来源:origin: projectdanube/xdi2

reader = XDIReaderRegistry.getAuto();
reader = XDIReaderRegistry.getAuto();

代码示例来源:origin: projectdanube/xdi2

XDIReader reader = XDIReaderRegistry.getAuto();

代码示例来源:origin: projectdanube/xdi2

XDIReader xdiReader = XDIReaderRegistry.getAuto();
XDIReader xdiReader = XDIReaderRegistry.getAuto();

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