public interface ConfigFormat<C extends Config>
| Modifier and Type | Method and Description |
|---|---|
default C |
createConcurrentConfig()
Creates a config of this format.
|
default C |
createConfig() |
C |
createConfig(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
Creates a config that uses the given map supplier for all its levels (top
level and subconfigs).
|
ConfigParser<C> |
createParser() |
ConfigWriter |
createWriter() |
default void |
initEmptyFile(java.io.File f)
Initializes an empty configuration file so that it can be parsed to an empty configuration.
|
default void |
initEmptyFile(java.nio.file.Path f)
Initializes an empty configuration file so that it can be parsed to an empty configuration.
|
default void |
initEmptyFile(WriterSupplier ws)
Initializes an empty configuration file so that it can be parsed to an empty configuration.
|
default boolean |
isInMemory()
Checks if this format is in memory only and therefore cannot create writers nor parsers.
|
boolean |
supportsComments()
Checks if this format supports CommentedConfigs.
|
default boolean |
supportsType(java.lang.Class<?> type)
Checks if this format supports the given type of value.
|
ConfigWriter createWriter()
ConfigParser<C> createParser()
default C createConfig()
default C createConcurrentConfig()
C createConfig(java.util.function.Supplier<java.util.Map<java.lang.String,java.lang.Object>> mapCreator)
mapCreator - the map supplier for the configboolean supportsComments()
true iff this format supports CommentedConfigsdefault boolean supportsType(java.lang.Class<?> type)
type - the type to check, may be null in which case this method checks if the format
supports null valuestrue iff this format supports the given typedefault boolean isInMemory()
true iff this format is only in memory.default void initEmptyFile(java.nio.file.Path f)
throws java.io.IOException
f - the existing file to initializejava.io.IOExceptiondefault void initEmptyFile(java.io.File f)
throws java.io.IOException
f - the existing file to initializejava.io.IOExceptiondefault void initEmptyFile(WriterSupplier ws) throws java.io.IOException
ws - an objet that provides a Writer to the file.java.io.IOException