mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-11-01 01:39:26 +00:00
Made TomlParser#run(String) static
This commit is contained in:
parent
b69f8514cb
commit
cdef758f4c
|
@ -123,7 +123,7 @@ public class Toml {
|
||||||
* @throws IllegalStateException If tomlString is not valid TOML
|
* @throws IllegalStateException If tomlString is not valid TOML
|
||||||
*/
|
*/
|
||||||
public Toml parse(String tomlString) throws IllegalStateException {
|
public Toml parse(String tomlString) throws IllegalStateException {
|
||||||
Results results = new TomlParser().run(tomlString);
|
Results results = TomlParser.run(tomlString);
|
||||||
if (results.errors.hasErrors()) {
|
if (results.errors.hasErrors()) {
|
||||||
throw new IllegalStateException(results.errors.toString());
|
throw new IllegalStateException(results.errors.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
class TomlParser {
|
class TomlParser {
|
||||||
|
|
||||||
Results run(String tomlString) {
|
static Results run(String tomlString) {
|
||||||
final Results results = new Results();
|
final Results results = new Results();
|
||||||
|
|
||||||
if (tomlString.isEmpty()) {
|
if (tomlString.isEmpty()) {
|
||||||
|
@ -57,4 +57,6 @@ class TomlParser {
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TomlParser() {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue