Top Description Constructors Methods
com.typesafe.config

public final Class ConfigUtil

extends Object
Class Inheritance
Imports
java.util.List, com.typesafe.config.impl.ConfigImplUtil

Contains static utility methods.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

a path expression
joinPath
(String...
the keys in the path
elements
)

Converts a list of keys to a path expression, by quoting the path elements as needed and then joining them separated by a period.

public static String

Returns:

a path expression
joinPath
(List<String>
the keys in the path
elements
)

Converts a list of strings to a path expression, by quoting the path elements as needed and then joining them separated by a period.

public static String

Returns:

the string quoted and escaped
quoteString
(String
a string
s
)

Quotes and escapes a string, as in the JSON specification.

public static List<String>

Returns:

the individual keys in the path
splitPath
(String
a path expression
path
)

Converts a path expression into a list of keys, by splitting on period and unquoting the individual path elements.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConfigUtilback to summary
private ConfigUtil()

Method Detail

joinPathback to summary
public static String joinPath(String... elements)

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 a Config, while individual path elements are usable with a ConfigObject.

See the overview documentation for Config for more detail on path expressions vs. keys.

Parameters
elements:String[]

the keys in the path

Returns:String

a path expression

Exceptions
ConfigException:
if there are no elements
joinPathback to summary
public static String joinPath(List<String> elements)

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 a Config, while individual path elements are usable with a ConfigObject.

See the overview documentation for Config for more detail on path expressions vs. keys.

Parameters
elements:List<String>

the keys in the path

Returns:String

a path expression

Exceptions
ConfigException:
if the list is empty
quoteStringback to summary
public static String quoteString(String s)

Quotes and escapes a string, as in the JSON specification.

Parameters
s:String

a string

Returns:String

the string quoted and escaped

splitPathback to summary
public static List<String> splitPath(String path)

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 a Config, while individual path elements are usable with a ConfigObject.

See the overview documentation for Config for more detail on path expressions vs. keys.

Parameters
path:String

a path expression

Returns:List<String>

the individual keys in the path

Exceptions
ConfigException:
if the path expression is invalid