本文整理匯總了Java中org.apache.commons.configuration.HierarchicalConfiguration.getStringArray方法的典型用法代碼示例。如果您正苦於以下問題:Java HierarchicalConfiguration.getStringArray方法的具體用法?Java HierarchicalConfiguration.getStringArray怎麽用?Java HierarchicalConfiguration.getStringArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.configuration.HierarchicalConfiguration
的用法示例。
在下文中一共展示了HierarchicalConfiguration.getStringArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: deserialize
import org.apache.commons.configuration.HierarchicalConfiguration; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public ConfigurationResult deserialize(InputStream input) throws ConfigurationException {
String content = new Scanner(input).useDelimiter("\\A").next();
HierarchicalConfiguration configuration = new HierarchicalConfiguration();
List<IncludeReference> includes = new ArrayList<>();
if (!content.isEmpty()) {
Object tree;
try {
tree = yaml.load(content);
} catch (ParserException e) {
throw new ConfigurationException("Failed to parse input as valid YAML.", e);
}
traverseTreeAndLoad(configuration.getRootNode(), null, includes, tree);
// Get the references from the special 'extends' key.
for (String reference : configuration.getStringArray("extends")) {
includes.add(new IncludeReference(reference));
}
}
return new ConfigurationResult(configuration, includes);
}