本文整理汇总了Java中jdk.nashorn.internal.ir.debug.JSONWriter类的典型用法代码示例。如果您正苦于以下问题:Java JSONWriter类的具体用法?Java JSONWriter怎么用?Java JSONWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JSONWriter类属于jdk.nashorn.internal.ir.debug包,在下文中一共展示了JSONWriter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import jdk.nashorn.internal.ir.debug.JSONWriter; //导入依赖的package包/类
/**
* Returns AST as JSON compatible string. This is used to
* implement "parse" function in resources/parse.js script.
*
* @param code code to be parsed
* @param name name of the code source (used for location)
* @param includeLoc tells whether to include location information for nodes or not
* @return JSON string representation of AST of the supplied code
*/
public static String parse(final String code, final String name, final boolean includeLoc) {
return JSONWriter.parse(Context.getContextTrusted(), code, name, includeLoc);
}
示例2: parse
import jdk.nashorn.internal.ir.debug.JSONWriter; //导入依赖的package包/类
/**
* Returns AST as JSON compatible string. This is used to
* implement "parse" function in resources/parse.js script.
*
* @param code code to be parsed
* @param name name of the code source (used for location)
* @param includeLoc tells whether to include location information for nodes or not
* @return JSON string representation of AST of the supplied code
*/
public static String parse(final String code, final String name, final boolean includeLoc) {
return JSONWriter.parse(Context.getContextTrusted().getEnv(), code, name, includeLoc);
}