本文整理了Java中com.sk89q.util.yaml.YAMLProcessor.getProperty()
方法的一些代码示例,展示了YAMLProcessor.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLProcessor.getProperty()
方法的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLProcessor
类名称:YAMLProcessor
方法名:getProperty
暂无
代码示例来源:origin: EngineHub/WorldGuard
public Object getProperty(String node) {
Object res = parentConfig.getProperty(node);
if (config.getProperty(node) != null) {
res = config.getProperty(node);
}
return res;
}
代码示例来源:origin: EngineHub/CommandBook
/**
* Loads the item list.
*
* @param config The {@link YAMLProcessor} to load from
*/
protected void loadItemList(YAMLProcessor config) {
// Load item names aliases list
Object itemNamesTemp = config.getProperty("item-names");
if (itemNamesTemp != null && itemNamesTemp instanceof Map) {
itemNames = new HashMap<String, Integer>();
try {
Map<?, ?> temp = (Map<?, ?>) itemNamesTemp;
for (Map.Entry<?, ?> entry : temp.entrySet()) {
String name = entry.getKey().toString().toLowerCase();
// Check if the item ID is a number
if (entry.getValue() instanceof Integer) {
itemNames.put(name, (Integer) entry.getValue());
}
}
} catch (ClassCastException ignore) {
}
} else {
itemNames = new HashMap<String, Integer>();
}
}
代码示例来源:origin: EngineHub/WorldGuard
public List<Integer> getIntList(String node, List<Integer> def) {
List<Integer> res = parentConfig.getIntList(node, def);
if (res == null || res.size() == 0) {
parentConfig.setProperty(node, new ArrayList<Integer>());
}
if (config.getProperty(node) != null) {
res = config.getIntList(node, def);
}
return res;
}
代码示例来源:origin: EngineHub/WorldGuard
public String getString(String node, String def) {
String val = parentConfig.getString(node, def);
if (config.getProperty(node) != null) {
return config.getString(node, def);
} else {
return val;
}
}
代码示例来源:origin: EngineHub/WorldGuard
public int getInt(String node, int def) {
int val = parentConfig.getInt(node, def);
if (config.getProperty(node) != null) {
return config.getInt(node, def);
} else {
return val;
}
}
代码示例来源:origin: EngineHub/WorldGuard
public boolean getBoolean(String node, boolean def) {
boolean val = parentConfig.getBoolean(node, def);
if (config.getProperty(node) != null) {
return config.getBoolean(node, def);
} else {
return val;
}
}
代码示例来源:origin: EngineHub/WorldGuard
@SuppressWarnings("unused")
private double getDouble(String node, double def) {
double val = parentConfig.getDouble(node, def);
if (config.getProperty(node) != null) {
return config.getDouble(node, def);
} else {
return val;
}
}
代码示例来源:origin: EngineHub/WorldGuard
public List<String> getStringList(String node, List<String> def) {
List<String> res = parentConfig.getStringList(node, def);
if (res == null || res.size() == 0) {
parentConfig.setProperty(node, new ArrayList<String>());
}
if (config.getProperty(node) != null) {
res = config.getStringList(node, def);
}
return res;
}
代码示例来源:origin: EngineHub/WorldGuard
Object hostKeysRaw = config.getProperty("host-keys");
if (!(hostKeysRaw instanceof Map)) {
config.setProperty("host-keys", new HashMap<String, String>());
内容来源于网络,如有侵权,请联系作者删除!