Class YamlImplementationCommentable
java.lang.Object
org.simpleyaml.configuration.implementation.api.YamlImplementationCommentable
- All Implemented Interfaces:
Commentable,YamlImplementation
- Direct Known Subclasses:
SnakeYamlImplementation
public abstract class YamlImplementationCommentable
extends Object
implements YamlImplementation, Commentable
A YAML implementation capable of processing comments.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected YamlConfigurationOptionsConfiguration options for loading and dumping Yaml.protected YamlCommentMapperA comment mapper to add comments to sections or values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(YamlConfigurationOptions options) Apply the configuration options to this implementation.getComment(String path, CommentType type) Retrieve the comment of the section or value selected by path.Get the comment mapper to get or set comments.voidsetComment(String path, String comment, CommentType type) Set a comment to the section or value selected by path.Methods 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, setComment
-
Field Details
-
yamlCommentMapper
A comment mapper to add comments to sections or values -
options
Configuration options for loading and dumping Yaml.
-
-
Constructor Details
-
YamlImplementationCommentable
public YamlImplementationCommentable()
-
-
Method Details
-
setComment
Description copied from interface:CommentableSet a comment to the section or value selected by path. Comment will be indented automatically. Multi-line comments can be provided using \n character.- Specified by:
setCommentin interfaceCommentable- Parameters:
path- path of desired section or keycomment- the comment to add, # symbol is not neededtype- either above (BLOCK) or SIDE
-
getComment
Description copied from interface:CommentableRetrieve the comment of the section or value selected by path.- Specified by:
getCommentin interfaceCommentable- Parameters:
path- path of desired section or keytype- either above (BLOCK) or SIDE- Returns:
- the comment of the section or value selected by path, or null if that path does not have any comment of this type
-
getCommentMapper
Get the comment mapper to get or set comments.- Returns:
- the comment mapper or null if parsing comments is not enabled
-
configure
Description copied from interface:YamlImplementationApply the configuration options to this implementation.- Specified by:
configurein interfaceYamlImplementation- Parameters:
options- yaml options
-