本文整理了Java中org.apache.jena.atlas.json.JSON.readAny()
方法的一些代码示例,展示了JSON.readAny()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JSON.readAny()
方法的具体详情如下:
包路径:org.apache.jena.atlas.json.JSON
类名称:JSON
方法名:readAny
[英]Read any JSON value, not just an object, from a file
[中]从文件中读取任何JSON值,而不仅仅是对象
代码示例来源:origin: apache/jena
public static void main(String... args)
{
if ( args.length == 0 )
args = new String[] {"-"} ;
try {
for ( String fn : args )
{
JsonValue json =null ;
try {
json = JSON.readAny(fn) ;
} catch (JsonParseException ex)
{
String name = fn.equals("-") ? "<stdin>" : fn ;
System.err.println(name+": "+JsonParseException.formatMessage(ex.getMessage(), ex.getLine(), ex.getColumn())) ;
continue ;
}
JSON.write(IndentedWriter.stdout, json) ;
IndentedWriter.stdout.ensureStartOfLine() ;
}
} finally { IndentedWriter.stdout.flush() ; }
}
代码示例来源:origin: org.apache.jena/jena-cmds
public static void main(String... args)
{
if ( args.length == 0 )
args = new String[] {"-"} ;
try {
for ( String fn : args )
{
JsonValue json =null ;
try {
json = JSON.readAny(fn) ;
} catch (JsonParseException ex)
{
String name = fn.equals("-") ? "<stdin>" : fn ;
System.err.println(name+": "+JsonParseException.formatMessage(ex.getMessage(), ex.getLine(), ex.getColumn())) ;
continue ;
}
JSON.write(IndentedWriter.stdout, json) ;
IndentedWriter.stdout.ensureStartOfLine() ;
}
} finally { IndentedWriter.stdout.flush() ; }
}
代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq
public static void main(String... args)
{
if ( args.length == 0 )
args = new String[] {"-"} ;
try {
for ( String fn : args )
{
JsonValue json =null ;
try {
json = JSON.readAny(fn) ;
} catch (JsonParseException ex)
{
String name = fn.equals("-") ? "<stdin>" : fn ;
System.err.println(name+": "+JsonParseException.formatMessage(ex.getMessage(), ex.getLine(), ex.getColumn())) ;
continue ;
}
JSON.write(IndentedWriter.stdout, json) ;
IndentedWriter.stdout.ensureStartOfLine() ;
}
} finally { IndentedWriter.stdout.flush() ; }
}
内容来源于网络,如有侵权,请联系作者删除!