本文整理汇总了Java中com.moandjiezana.toml.Toml.getTables方法的典型用法代码示例。如果您正苦于以下问题:Java Toml.getTables方法的具体用法?Java Toml.getTables怎么用?Java Toml.getTables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.moandjiezana.toml.Toml
的用法示例。
在下文中一共展示了Toml.getTables方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addConfigurations
import com.moandjiezana.toml.Toml; //导入方法依赖的package包/类
/**
* Register a new configuration file containing Talon parameters. These parameter objects will be
* merged with existing parameter objects. If a new parameter object has the same name as an
* existing object, the old object will be overwritten.
*
* @param configs a parsed config collection
*/
public void addConfigurations(Toml configs) {
List<Toml> configList = configs.getTables(TALON_TABLE);
if (configList == null) {
logger.error("no " + TALON_TABLE + " tables in config");
return;
}
for (Toml config : configList) {
String name = config.getString(TalonConfigurationBuilder.NAME);
if (name == null) {
throw new IllegalArgumentException(TALON_TABLE + " configuration name parameter missing");
}
settings.put(name, TalonConfigurationBuilder.create(config));
logger.info("added configuration: {}", name);
}
}
示例2: parse
import com.moandjiezana.toml.Toml; //导入方法依赖的package包/类
@Override
public void parse(Reader source, Toml data) throws Exception {
for (Toml toml : data.getTables("frame")) {
int id = getInteger(toml, "id");
int length = getInteger(toml, "length");
frames.put(id, length);
}
}
示例3: parse
import com.moandjiezana.toml.Toml; //导入方法依赖的package包/类
@Override
public void parse(Reader source, Toml data) throws Exception {
for (Toml toml : data.getTables("parser")) {
String path = toml.getString("path");
String name = toml.getString("name");
@SuppressWarnings("unchecked")
Class<Parser<?, ?>> clazz = (Class<Parser<?, ?>>) Class.forName(name);
Parser<?, ?> parser = find(clazz, path);
context.addParser(clazz, parser);
parser.parse();
}
}