当前位置: 首页>>代码示例>>Java>>正文


Java JsonML类代码示例

本文整理汇总了Java中com.google.javascript.jscomp.jsonml.JsonML的典型用法代码示例。如果您正苦于以下问题:Java JsonML类的具体用法?Java JsonML怎么用?Java JsonML使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JsonML类属于com.google.javascript.jscomp.jsonml包,在下文中一共展示了JsonML类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testJsonMLToAstConversion

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testJsonMLToAstConversion(String js) throws Exception {
  JsonML jsonml = JsonMLParser.parse(js);
  Node root = parseExpectedJs(js);
  Node ast = root.getFirstChild();
  Preconditions.checkState(ast.getType() == Token.SCRIPT);

  testJsonMLToAstConversion(ast, jsonml, js);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:JsonMLConversionTest.java

示例2: testAstToJsonMLConverstion

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testAstToJsonMLConverstion(Node astRoot, JsonML jsonmlRoot,
    String js) {
  JsonML resultJsonMLRoot = (new Writer()).processAst(astRoot);
  String explanation = JsonMLUtil.compare(resultJsonMLRoot, jsonmlRoot);
  assertNull("AST -> JsonML converter returned incorrect result for " + js +
      "\n" + explanation, explanation);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:JsonMLConversionTest.java

示例3: testConversion

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testConversion(String js) throws Exception {
  JsonML jsonml = JsonMLParser.parse(js);
  Node root = parseExpectedJs(js);
  Node ast = root.getFirstChild();
  Preconditions.checkState(ast.getType() == Token.SCRIPT);

  testJsonMLToAstConversion(ast, jsonml, js);

  jsonml = JsonMLParser.parse(js);
  testAstToJsonMLConverstion(ast, jsonml, js);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:JsonMLConversionTest.java

示例4: testSuccess

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testSuccess(JsonML source) throws Exception {
  SecureCompiler compiler = new SecureCompiler();
  compiler.compile(source);
  Report report = compiler.getReport();
  assertTrue(report.isSuccessful());
  assertEquals(0, report.getErrors().length);
  assertEquals(0, report.getWarnings().length);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:SecureCompilerTest.java

示例5: testValidation

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testValidation(String jsonml) throws Exception {
  JsonML jsonMLRoot = JsonMLUtil.parseString(jsonml);
  String msg = Validator.validate(jsonMLRoot);
  if (msg != null) {
    String errorMsg = String.format(
        "Validation error for %s.\n Received: %s\n", jsonml, msg);
  }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:JsonMLValidationTest.java

示例6: testError

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testError(JsonML source) throws Exception {
  SecureCompiler compiler = new SecureCompiler();
  compiler.compile(source);
  Report report = compiler.getReport();
  assertFalse(report.isSuccessful());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:7,代码来源:SecureCompilerTest.java

示例7: testString

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testString(String jsonml) throws Exception {
  JsonML source = JsonMLUtil.parseString(jsonml);
  testSuccess(source);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:SecureCompilerTest.java

示例8: testInvalidString

import com.google.javascript.jscomp.jsonml.JsonML; //导入依赖的package包/类
private void testInvalidString(String jsonml) throws Exception {
  JsonML source = JsonMLUtil.parseString(jsonml);
  testError(source);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:SecureCompilerTest.java


注:本文中的com.google.javascript.jscomp.jsonml.JsonML类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。