Class PropertiesFormat
java.lang.Object
dev.siroshun.configapi.format.properties.PropertiesFormat
- All Implemented Interfaces:
FileFormat<MapNode>
A
FileFormat implementation that loading/saving MapNode from/to properties files.
When loading from properties file, all keys/values will store as String/StringValue.
Saving to properties file supports StringRepresentable nodes and CommentedNode with StringRepresentable node.
Other Node types will throw IllegalArgumentException.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertiesFormatA default instance ofPropertiesFormat. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.siroshun.configapi.core.file.FileFormat
load, load, save, save
-
Field Details
-
DEFAULT
A default instance ofPropertiesFormat.
-
-
Method Details
-
load
Description copied from interface:FileFormatLoads a node from aReader.- Specified by:
loadin interfaceFileFormat<MapNode>- Parameters:
reader- aReaderto load a node- Returns:
- a loaded
Node(FileFormat) - Throws:
IOException- if I/O error occurred
-
save
public void save(@NotNull @NotNull MapNode node, @NotNull @NotNull Writer writer) throws IOException Description copied from interface:FileFormatSaves a node to aWriter.- Specified by:
savein interfaceFileFormat<MapNode>- Parameters:
node- a rootNode(FileFormat) to savewriter- aWriterto write a node- Throws:
IOException- if I/O error occurred
-