Class YamlFormat
java.lang.Object
com.github.siroshun09.configapi.format.yaml.YamlFormat
- All Implemented Interfaces:
FileFormat<MapNode>
A
FileFormat
implementation that loading/saving MapNode
from/to yaml files.
Supported Node
s:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final YamlFormat
An instance ofYamlFormat
that processes the comments.static final YamlFormat
An instance of defaultYamlFormat
. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.siroshun09.configapi.core.file.FileFormat
load, load, save, save
-
Field Details
-
DEFAULT
An instance of defaultYamlFormat
. -
COMMENT_PROCESSING
An instance ofYamlFormat
that processes the comments.
-
-
Method Details
-
builder
Creates a newYamlFormat.Builder
.- Returns:
- a new
YamlFormat.Builder
-
load
Description copied from interface:FileFormat
Loads a node from aReader
.- Specified by:
load
in interfaceFileFormat<MapNode>
- Parameters:
reader
- aReader
to 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:FileFormat
Saves a node to aWriter
.- Specified by:
save
in interfaceFileFormat<MapNode>
- Parameters:
node
- a rootNode
(FileFormat
) to savewriter
- aWriter
to write a node- Throws:
IOException
- if I/O error occurred
-