Class TomlParser
java.lang.Object
com.electronwill.nightconfig.toml.TomlParser
- All Implemented Interfaces:
com.electronwill.nightconfig.core.io.ConfigParser<com.electronwill.nightconfig.core.CommentedConfig>
public final class TomlParser
extends Object
implements com.electronwill.nightconfig.core.io.ConfigParser<com.electronwill.nightconfig.core.CommentedConfig>
A configurable parser of TOML configurations. It is not thread-safe.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.electronwill.nightconfig.core.ConfigFormat<com.electronwill.nightconfig.core.CommentedConfig>booleanbooleancom.electronwill.nightconfig.core.CommentedConfigvoidparse(Reader reader, com.electronwill.nightconfig.core.Config destination, com.electronwill.nightconfig.core.io.ParsingMode parsingMode) setInitialListCapacity(int initialListCapacity) setInitialStringBuilderCapacity(int initialStringBuilderCapacity) setLenientWithBareKeys(boolean lenientBareKeys) Makes this parser lenient (if true) or strict (if false - this is the default) with bar keys.setLenientWithSeparators(boolean lenientSeparators) Makes this parser lenient (if true) or strict (if false - this is the default) with key/values separators.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.electronwill.nightconfig.core.io.ConfigParser
parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse, parse
-
Constructor Details
-
TomlParser
public TomlParser()
-
-
Method Details
-
parse
- Specified by:
parsein interfacecom.electronwill.nightconfig.core.io.ConfigParser<com.electronwill.nightconfig.core.CommentedConfig>
-
parse
public void parse(Reader reader, com.electronwill.nightconfig.core.Config destination, com.electronwill.nightconfig.core.io.ParsingMode parsingMode) - Specified by:
parsein interfacecom.electronwill.nightconfig.core.io.ConfigParser<com.electronwill.nightconfig.core.CommentedConfig>
-
isLenientWithSeparators
public boolean isLenientWithSeparators() -
setLenientWithSeparators
Makes this parser lenient (if true) or strict (if false - this is the default) with key/values separators. In lenient mode, the parser accepts both '=' and ':' between keys and values. In strict mode, only the standard '=' is accepted.- Parameters:
lenientSeparators- true for lenient, false for strict- Returns:
- this parser
-
isLenientWithBareKeys
public boolean isLenientWithBareKeys() -
setLenientWithBareKeys
Makes this parser lenient (if true) or strict (if false - this is the default) with bar keys. In lenient mode, almost all characters are allowed in bare keys. In struct mode, only the standard A-Za-z0-9_- range is allowed.- Parameters:
lenientBareKeys- true for lenient, false for strict- Returns:
- this parser
-
setInitialStringBuilderCapacity
-
setInitialListCapacity
-
getFormat
public com.electronwill.nightconfig.core.ConfigFormat<com.electronwill.nightconfig.core.CommentedConfig> getFormat()- Specified by:
getFormatin interfacecom.electronwill.nightconfig.core.io.ConfigParser<com.electronwill.nightconfig.core.CommentedConfig>
-