mirror of
https://github.com/lightbend/config.git
synced 2025-01-15 23:01:05 +08:00
add ConfigFactory.parseString
This commit is contained in:
parent
31b9ccf983
commit
7cdbe721a9
@ -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
|
||||
|
@ -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) = {
|
||||
|
Loading…
Reference in New Issue
Block a user