public class TOMLConfigParser extends Object
| Constructor and Description |
|---|
TOMLConfigParser() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
parse(String configFilePath,
Class<T> type)
Parses the given TOML configuration file and de-serialize the content into given config type.
|
static void |
write(String configFilePath,
Object content)
Write the given config type to a file.
|
public static <T> T parse(String configFilePath, Class<T> type) throws ConfigParserException
T - type of the config class to be used when de-serializingconfigFilePath - path to toml filetype - class of the config to be used when de-serializingConfigParserException - if cannot read or parse the content of the specified TOML filepublic static void write(String configFilePath, Object content) throws ConfigParserException
configFilePath - path to toml filecontent - type of the config class to be used when de-serializingConfigParserException - if cannot write the content to file or specified file does not existCopyright © 2019 WSO2. All rights reserved.