Class SnakeYamlImplementation
java.lang.Object
org.simpleyaml.configuration.implementation.api.YamlImplementationCommentable
org.simpleyaml.configuration.implementation.snakeyaml.SnakeYamlImplementation
- All Implemented Interfaces:
org.simpleyaml.configuration.comments.Commentable,YamlImplementation
- Direct Known Subclasses:
SimpleYamlImplementation
YAML implementation using snakeyaml low-level API and snakeyaml comment processing available if
YamlConfigurationOptions.useComments() is enabled.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.yaml.snakeyaml.DumperOptionsprotected final org.yaml.snakeyaml.LoaderOptionsprotected final org.yaml.snakeyaml.resolver.Resolverprotected final org.yaml.snakeyaml.Yamlprotected final SnakeYamlConstructorprotected final SnakeYamlRepresenterFields inherited from class org.simpleyaml.configuration.implementation.api.YamlImplementationCommentable
options, yamlCommentMapper -
Constructor Summary
ConstructorsConstructorDescriptionSnakeYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter) SnakeYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter, org.yaml.snakeyaml.resolver.Resolver resolver) SnakeYamlImplementation(SnakeYamlRepresenter yamlRepresenter) SnakeYamlImplementation(org.yaml.snakeyaml.LoaderOptions loaderOptions, org.yaml.snakeyaml.DumperOptions dumperOptions) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(YamlConfigurationOptions options) Apply the configuration options to this implementation.voidDump section values to Yaml.protected voidorg.yaml.snakeyaml.DumperOptionsorg.yaml.snakeyaml.LoaderOptionsprotected StringgetName(org.yaml.snakeyaml.nodes.Node node, boolean key) org.yaml.snakeyaml.resolver.Resolverorg.yaml.snakeyaml.YamlgetYaml()protected booleanhasContent(Writer writer, org.simpleyaml.configuration.ConfigurationSection section) voidLoad Yaml to a configuration section.protected static org.yaml.snakeyaml.nodes.NoderesolveAnchor(org.yaml.snakeyaml.nodes.Node node) protected org.yaml.snakeyaml.nodes.MappingNodesectionToMapping(org.simpleyaml.configuration.ConfigurationSection section, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) voidsetComment(String path, String comment, org.simpleyaml.configuration.comments.CommentType type) protected voidsetCommentsMapping(org.yaml.snakeyaml.nodes.MappingNode mapping, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) protected voidsetCommentsSequence(org.yaml.snakeyaml.nodes.SequenceNode sequence, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) protected voidtrackMapping(org.yaml.snakeyaml.nodes.MappingNode node, org.simpleyaml.configuration.ConfigurationSection section, org.simpleyaml.configuration.comments.KeyTree.Node parent, SnakeYamlCommentMapper yamlCommentMapper) protected voidtrackSequence(org.yaml.snakeyaml.nodes.SequenceNode node, org.simpleyaml.configuration.comments.KeyTree.Node parent, SnakeYamlCommentMapper yamlCommentMapper) Methods inherited from class org.simpleyaml.configuration.implementation.api.YamlImplementationCommentable
getComment, getCommentMapperMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.simpleyaml.configuration.comments.Commentable
getComment, setCommentMethods inherited from interface org.simpleyaml.configuration.implementation.api.YamlImplementation
dump, load, load
-
Field Details
-
yamlConstructor
-
yamlRepresenter
-
dumperOptions
protected final org.yaml.snakeyaml.DumperOptions dumperOptions -
loaderOptions
protected final org.yaml.snakeyaml.LoaderOptions loaderOptions -
resolver
protected final org.yaml.snakeyaml.resolver.Resolver resolver -
yaml
protected final org.yaml.snakeyaml.Yaml yaml
-
-
Constructor Details
-
SnakeYamlImplementation
public SnakeYamlImplementation() -
SnakeYamlImplementation
public SnakeYamlImplementation(org.yaml.snakeyaml.LoaderOptions loaderOptions, org.yaml.snakeyaml.DumperOptions dumperOptions) -
SnakeYamlImplementation
-
SnakeYamlImplementation
public SnakeYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter) -
SnakeYamlImplementation
public SnakeYamlImplementation(SnakeYamlConstructor yamlConstructor, SnakeYamlRepresenter yamlRepresenter, org.yaml.snakeyaml.resolver.Resolver resolver)
-
-
Method Details
-
getYaml
public org.yaml.snakeyaml.Yaml getYaml() -
getConstructor
-
getRepresenter
-
getDumperOptions
public org.yaml.snakeyaml.DumperOptions getDumperOptions() -
getLoaderOptions
public org.yaml.snakeyaml.LoaderOptions getLoaderOptions() -
getResolver
public org.yaml.snakeyaml.resolver.Resolver getResolver() -
load
public void load(Reader reader, org.simpleyaml.configuration.ConfigurationSection section) throws IOException, org.simpleyaml.exceptions.InvalidConfigurationException Description copied from interface:YamlImplementationLoad Yaml to a configuration section.- Parameters:
reader- a reader of Yaml contents to loadsection- the configuration to fill with the contents- Throws:
IOException- if cannot read contents.org.simpleyaml.exceptions.InvalidConfigurationException- if contents is not a valid Yaml configuration
-
dump
public void dump(Writer writer, org.simpleyaml.configuration.ConfigurationSection section) throws IOException Description copied from interface:YamlImplementationDump section values to Yaml.- Parameters:
writer- writer to dump valuessection- section with values to dump- Throws:
IOException
-
dumpYaml
protected void dumpYaml(Writer writer, org.simpleyaml.configuration.ConfigurationSection section) throws IOException - Throws:
IOException
-
hasContent
protected boolean hasContent(Writer writer, org.simpleyaml.configuration.ConfigurationSection section) throws IOException - Throws:
IOException
-
configure
Description copied from interface:YamlImplementationApply the configuration options to this implementation.- Specified by:
configurein interfaceYamlImplementation- Overrides:
configurein classYamlImplementationCommentable- Parameters:
options- yaml options
-
setComment
public void setComment(String path, String comment, org.simpleyaml.configuration.comments.CommentType type) - Specified by:
setCommentin interfaceorg.simpleyaml.configuration.comments.Commentable- Overrides:
setCommentin classYamlImplementationCommentable
-
trackMapping
protected void trackMapping(org.yaml.snakeyaml.nodes.MappingNode node, org.simpleyaml.configuration.ConfigurationSection section, org.simpleyaml.configuration.comments.KeyTree.Node parent, SnakeYamlCommentMapper yamlCommentMapper) -
trackSequence
protected void trackSequence(org.yaml.snakeyaml.nodes.SequenceNode node, org.simpleyaml.configuration.comments.KeyTree.Node parent, SnakeYamlCommentMapper yamlCommentMapper) -
sectionToMapping
protected org.yaml.snakeyaml.nodes.MappingNode sectionToMapping(org.simpleyaml.configuration.ConfigurationSection section, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) -
setCommentsSequence
protected void setCommentsSequence(org.yaml.snakeyaml.nodes.SequenceNode sequence, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) -
setCommentsMapping
protected void setCommentsMapping(org.yaml.snakeyaml.nodes.MappingNode mapping, org.simpleyaml.configuration.comments.KeyTree.Node node, SnakeYamlCommentMapper yamlCommentMapper) -
getName
-
resolveAnchor
protected static org.yaml.snakeyaml.nodes.Node resolveAnchor(org.yaml.snakeyaml.nodes.Node node)
-