本文整理了Java中org.geotools.ysld.parse.YamlParseContext.<init>()
方法的一些代码示例,展示了YamlParseContext.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlParseContext.<init>()
方法的具体详情如下:
包路径:org.geotools.ysld.parse.YamlParseContext
类名称:YamlParseContext
方法名:<init>
暂无
代码示例来源:origin: geotools/geotools
/**
* Parse the yaml provided to this instance using the provided {@link YamlParseHandler}.
*
* @param root The {@link YamlParseHandler} that handles the root of the parsed {@link
* YamlObject}.
* @param hints
* @return The root {@link YamlParseHandler}, once it has finished handling the parsed {@link
* YamlObject}..
* @throws IOException
*/
@SuppressWarnings("PMD.EmptyWhileStmt")
public <T extends YamlParseHandler> T parse(T root, Map<String, Object> hints)
throws IOException {
Object parsed = YamlUtil.getSafeYaml().load(yaml);
YamlParseContext context = new YamlParseContext();
context.mergeDocHints(hints);
context.push(YamlObject.create(parsed), root);
while (context.next()) ;
return root;
}
}
代码示例来源:origin: geotools/geotools
@Test
public void testDocHints() throws Exception {
YamlParseContext ctxt = new YamlParseContext();
YamlParseHandler handler = createMock(YamlParseHandler.class);
YamlObject obj1 = createMock(YamlObject.class);
replay(handler);
ctxt.push(obj1, handler);
assertThat(ctxt.getDocHint("testHint1"), nullValue());
ctxt.setDocHint("testHint1", "th1v1");
assertThat((String) ctxt.getDocHint("testHint1"), is("th1v1"));
ctxt.setDocHint("testHint1", "th1v2");
assertThat((String) ctxt.getDocHint("testHint1"), is("th1v2"));
assertThat(ctxt.getDocHint("testHint2"), nullValue());
ctxt.setDocHint("testHint2", "th2v1");
assertThat((String) ctxt.getDocHint("testHint2"), is("th2v1"));
assertThat((String) ctxt.getDocHint("testHint1"), is("th1v2"));
verify(handler);
}
}
代码示例来源:origin: org.geotools/gt-ysld
/**
* Parse the yaml provided to this instance using the provided {@link YamlParseHandler}.
*
* @param root The {@link YamlParseHandler} that handles the root of the parsed {@link
* YamlObject}.
* @param hints
* @return The root {@link YamlParseHandler}, once it has finished handling the parsed {@link
* YamlObject}..
* @throws IOException
*/
public <T extends YamlParseHandler> T parse(T root, Map<String, Object> hints)
throws IOException {
Object parsed = YamlUtil.getSafeYaml().load(yaml);
YamlParseContext context = new YamlParseContext();
context.mergeDocHints(hints);
context.push(YamlObject.create(parsed), root);
while (context.next()) ;
return root;
}
}
内容来源于网络,如有侵权,请联系作者删除!