本文整理了Java中org.geotools.ysld.parse.YamlParseContext.getDocHint()
方法的一些代码示例,展示了YamlParseContext.getDocHint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlParseContext.getDocHint()
方法的具体详情如下:
包路径:org.geotools.ysld.parse.YamlParseContext
类名称:YamlParseContext
方法名:getDocHint
暂无
代码示例来源:origin: geotools/geotools
protected ZoomContext getZoomContext(YamlParseContext context) {
return Util.forceDefaultForNull(
(ZoomContext) context.getDocHint(ZoomContext.HINT_ID),
WellKnownZoomContextFinder.getInstance().get("DEFAULT"));
}
}
代码示例来源: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: geotools/geotools
@Override
public void handle(YamlObject<?> obj, YamlParseContext context) {
YamlMap map = obj.map();
sym.setName(map.str("name"));
if (map.has("geometry")) {
sym.setGeometry(Util.expression(map.str("geometry"), factory));
}
UomMapper uomMapper = (UomMapper) context.getDocHint(UomMapper.KEY);
if (map.has("uom")) {
sym.setUnitOfMeasure(uomMapper.getUnit(map.str("uom")));
}
sym.getOptions().putAll(Util.vendorOptions(map));
}
}
代码示例来源:origin: geotools/geotools
@Override
public void handle(YamlObject<?> obj, YamlParseContext context) {
externalGraphic(external);
YamlMap map = obj.map();
if (map.has("url")) {
String value = map.str("url");
try {
external.setLocation(
((ResourceLocator) context.getDocHint("resourceLocator"))
.locateResource(value));
} catch (IllegalArgumentException e) {
external.setURI("file:" + value);
}
}
external.setFormat(map.str("format"));
}
}
代码示例来源:origin: org.geotools/gt-ysld
protected ZoomContext getZoomContext(YamlParseContext context) {
return Util.forceDefaultForNull(
(ZoomContext) context.getDocHint(ZoomContext.HINT_ID),
WellKnownZoomContextFinder.getInstance().get("DEFAULT"));
}
}
代码示例来源:origin: org.geotools/gt-ysld
@Override
public void handle(YamlObject<?> obj, YamlParseContext context) {
YamlMap map = obj.map();
sym.setName(map.str("name"));
if (map.has("geometry")) {
sym.setGeometry(Util.expression(map.str("geometry"), factory));
}
UomMapper uomMapper = (UomMapper) context.getDocHint(UomMapper.KEY);
if (map.has("uom")) {
sym.setUnitOfMeasure(uomMapper.getUnit(map.str("uom")));
}
sym.getOptions().putAll(Util.vendorOptions(map));
}
}
代码示例来源:origin: org.geotools/gt-ysld
@Override
public void handle(YamlObject<?> obj, YamlParseContext context) {
externalGraphic(external);
YamlMap map = obj.map();
if (map.has("url")) {
String value = map.str("url");
try {
external.setLocation(
((ResourceLocator) context.getDocHint("resourceLocator"))
.locateResource(value));
} catch (IllegalArgumentException e) {
external.setURI("file:" + value);
}
}
external.setFormat(map.str("format"));
}
}
内容来源于网络,如有侵权,请联系作者删除!