add ConfigFactory.parseString

This commit is contained in:
Havoc Pennington 2011-11-17 21:33:36 -05:00
parent 31b9ccf983
commit 7cdbe721a9
2 changed files with 5 additions and 1 deletions

View File

@ -147,6 +147,10 @@ public final class ConfigFactory {
.toConfig();
}
public static Config parseString(String s, ConfigParseOptions options) {
return Parseable.newString(s, options).parse().toConfig();
}
/**
* Parses classpath resources corresponding to this path expression.
* Essentially if the path is "foo.bar" then the resources are

View File

@ -340,7 +340,7 @@ abstract trait TestUtils {
val options = ConfigParseOptions.defaults().
setOriginDescription("test string").
setSyntax(ConfigSyntax.CONF);
ConfigFactory.parseReader(new StringReader(s), options).asInstanceOf[SimpleConfig]
ConfigFactory.parseString(s, options).asInstanceOf[SimpleConfig]
}
protected def subst(ref: String) = {