Package com.typesafe.config
Class ConfigUtil
java.lang.Object
com.typesafe.config.ConfigUtil
Contains static utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period.static String
Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period.static String
Quotes and escapes a string, as in the JSON specification.Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements.
-
Method Details
-
quoteString
Quotes and escapes a string, as in the JSON specification.- Parameters:
s
- a string- Returns:
- the string quoted and escaped
-
joinPath
Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with aConfig
, while individual path elements are usable with aConfigObject
.See the overview documentation for
Config
for more detail on path expressions vs. keys.- Parameters:
elements
- the keys in the path- Returns:
- a path expression
- Throws:
ConfigException
- if there are no elements
-
joinPath
Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period. A path expression is usable with aConfig
, while individual path elements are usable with aConfigObject
.See the overview documentation for
Config
for more detail on path expressions vs. keys.- Parameters:
elements
- the keys in the path- Returns:
- a path expression
- Throws:
ConfigException
- if the list is empty
-
splitPath
Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements. A path expression is usable with aConfig
, while individual path elements are usable with aConfigObject
.See the overview documentation for
Config
for more detail on path expressions vs. keys.- Parameters:
path
- a path expression- Returns:
- the individual keys in the path
- Throws:
ConfigException
- if the path expression is invalid
-