本文整理了Java中com.sk89q.util.yaml.YAMLNode.getString()
方法的一些代码示例,展示了YAMLNode.getString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLNode.getString()
方法的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLNode
类名称:YAMLNode
方法名:getString
[英]Gets a string at a location. This will either return an String or null, with null meaning that no configuration value exists at that location. If the object at the particular location is not actually a string, it will be converted to its string representation.
[中]在某个位置获取字符串。这将返回字符串或null,null表示该位置不存在配置值。如果特定位置的对象实际上不是字符串,它将转换为其字符串表示形式。
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a string at a location. This will either return an String
* or the default value. If the object at the particular location is not
* actually a string, it will be converted to its string representation.
*
* @param path path to node (dot notation)
* @param def default value
* @return string or default
*/
public String getString(String path, String def) {
String o = getString(path);
if (o == null) {
if (writeDefaults) setProperty(path, def);
return def;
}
return o;
}
代码示例来源:origin: EngineHub/WorldGuard
YAMLNode node = entry.getValue();
String type = node.getString("type");
ProtectedRegion region;
String parentId = node.getString("parent");
if (parentId != null) {
parentSets.put(region, parentId);
内容来源于网络,如有侵权,请联系作者删除!