Package groovy.toml
Class TomlSlurper
java.lang.Object
groovy.toml.TomlSlurper
Represents a TOML parser
- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionParse the content of the specified file into a tree of Nodes.parse(InputStream stream) Parse the content of the specified reader into a tree of Nodes.Parse the content of the specified reader into a tree of Nodes.Parse the content of the specified path into a tree of Nodes.<T> TParse TOML from a file into a typed object.<T> TparseAs(Class<T> type, InputStream stream) Parse TOML from an input stream into a typed object.<T> TParse TOML from a reader into a typed object.<T> TParse TOML from a path into a typed object.Parse the content of the specified toml into a tree of Nodes.<T> TparseTextAs(Class<T> type, String toml) Parse the content of the specified TOML text into a typed object using Jackson databinding.
-
Constructor Details
-
TomlSlurper
public TomlSlurper()
-
-
Method Details
-
parseText
Parse the content of the specified toml into a tree of Nodes.- Parameters:
toml- the content of toml- Returns:
- the root node of the parsed tree of Nodes
-
parse
Parse the content of the specified reader into a tree of Nodes.- Parameters:
reader- the reader of toml- Returns:
- the root node of the parsed tree of Nodes
-
parse
Parse the content of the specified reader into a tree of Nodes.- Parameters:
stream- the reader of toml- Returns:
- the root node of the parsed tree of Nodes
-
parse
Parse the content of the specified file into a tree of Nodes.- Parameters:
file- the reader of toml- Returns:
- the root node of the parsed tree of Nodes
- Throws:
IOException
-
parse
Parse the content of the specified path into a tree of Nodes.- Parameters:
path- the reader of toml- Returns:
- the root node of the parsed tree of Nodes
- Throws:
IOException
-
parseTextAs
Parse the content of the specified TOML text into a typed object using Jackson databinding. Supports@JsonPropertyand@JsonFormatannotations for property mapping and type conversion.- Type Parameters:
T- the target type- Parameters:
type- the target typetoml- the content of TOML- Returns:
- a typed object
- Since:
- 6.0.0
-
parseAs
Parse TOML from a reader into a typed object.- Type Parameters:
T- the target type- Parameters:
type- the target typereader- the reader of TOML- Returns:
- a typed object
- Since:
- 6.0.0
-
parseAs
Parse TOML from an input stream into a typed object.- Type Parameters:
T- the target type- Parameters:
type- the target typestream- the input stream of TOML- Returns:
- a typed object
- Since:
- 6.0.0
-
parseAs
Parse TOML from a file into a typed object.- Type Parameters:
T- the target type- Parameters:
type- the target typefile- the TOML file- Returns:
- a typed object
- Throws:
IOException- Since:
- 6.0.0
-
parseAs
Parse TOML from a path into a typed object.- Type Parameters:
T- the target type- Parameters:
type- the target typepath- the path to the TOML file- Returns:
- a typed object
- Throws:
IOException- Since:
- 6.0.0
-