public class SimpleYamlImplementation extends SnakeYamlImplementation
dumperOptions, loaderOptions, resolver, yaml, yamlConstructor, yamlRepresenter
options, yamlCommentMapper
Constructor and Description |
---|
SimpleYamlImplementation() |
SimpleYamlImplementation(org.yaml.snakeyaml.LoaderOptions loaderOptions,
org.yaml.snakeyaml.DumperOptions dumperOptions) |
SimpleYamlImplementation(SnakeYamlConstructor yamlConstructor,
SnakeYamlRepresenter yamlRepresenter) |
SimpleYamlImplementation(SnakeYamlConstructor yamlConstructor,
SnakeYamlRepresenter yamlRepresenter,
org.yaml.snakeyaml.resolver.Resolver resolver) |
SimpleYamlImplementation(SnakeYamlRepresenter yamlRepresenter) |
Modifier and Type | Method and Description |
---|---|
void |
configure(YamlConfigurationOptions options)
Apply the configuration options to this implementation.
|
void |
dump(Writer writer,
ConfigurationSection section)
Dump section values to Yaml.
|
void |
load(Reader reader,
ConfigurationSection section)
Load Yaml to a configuration section.
|
void |
load(SupplierIO.Reader readerSupplier,
ConfigurationSection section)
Load Yaml to a configuration section.
|
YamlCommentMapper |
parseComments(Reader reader)
Parse comments from a reader.
|
void |
setComment(String path,
String comment,
CommentType type)
Set a comment to the section or value selected by path.
|
dumpYaml, getConstructor, getDumperOptions, getLoaderOptions, getName, getRepresenter, getResolver, getYaml, hasContent, resolveAnchor, sectionToMapping, setCommentsMapping, setCommentsSequence, trackMapping, trackSequence
getComment, getCommentMapper
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dump, load
getComment, setComment
public SimpleYamlImplementation()
public SimpleYamlImplementation(org.yaml.snakeyaml.LoaderOptions loaderOptions, org.yaml.snakeyaml.DumperOptions dumperOptions)
public SimpleYamlImplementation(SnakeYamlRepresenter yamlRepresenter)
public SimpleYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter)
public SimpleYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter, org.yaml.snakeyaml.resolver.Resolver resolver)
public void setComment(String path, String comment, CommentType type)
Commentable
setComment
in interface Commentable
setComment
in class SnakeYamlImplementation
path
- path of desired section or keycomment
- the comment to add, # symbol is not neededtype
- either above (BLOCK) or SIDEpublic void load(SupplierIO.Reader readerSupplier, ConfigurationSection section) throws IOException, InvalidConfigurationException
YamlImplementation
readerSupplier
- a function providing a reader of Yaml contents to loadsection
- the configuration to fill with the contentsIOException
- if cannot read contents.InvalidConfigurationException
- if contents is not a valid Yaml configurationpublic void load(Reader reader, ConfigurationSection section) throws IOException, InvalidConfigurationException
YamlImplementation
load
in interface YamlImplementation
load
in class SnakeYamlImplementation
reader
- a reader of Yaml contents to loadsection
- the configuration to fill with the contentsIOException
- if cannot read contents.InvalidConfigurationException
- if contents is not a valid Yaml configurationpublic void dump(Writer writer, ConfigurationSection section) throws IOException
YamlImplementation
dump
in interface YamlImplementation
dump
in class SnakeYamlImplementation
writer
- writer to dump valuessection
- section with values to dumpIOException
public YamlCommentMapper parseComments(Reader reader) throws InvalidConfigurationException
reader
- Reader of a Configuration to parse.InvalidConfigurationException
- if it hasn't been possible to read the contentspublic void configure(YamlConfigurationOptions options)
YamlImplementation
configure
in interface YamlImplementation
configure
in class SnakeYamlImplementation
options
- yaml optionsCopyright © 2023. All rights reserved.