Class YamlCommentMapper
java.lang.Object
org.simpleyaml.configuration.comments.YamlCommentMapper
- All Implemented Interfaces:
Commentable
- Direct Known Subclasses:
SnakeYamlCommentMapper,YamlCommentReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final KeyTreeprotected static final Predicate<KeyTree.Node> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearNode(KeyTree.Node node) protected voidgetComment(String path, CommentType type) Retrieve the comment of the section or value selected by path.protected final StringgetComment(KeyTree.Node node, CommentType type) protected KeyTree.NodegetOrAddNode(String path) protected KeyTree.NodegetPriorityNode(String path) getRawComment(String path, CommentType type) protected final StringgetRawComment(KeyTree.Node node, CommentType type) protected YamlConfigurationOptionsoptions()voidremoveComment(String path, CommentType type) protected final voidremoveComment(KeyTree.Node node, CommentType type) voidsetComment(String path, String comment, CommentType type) Set a comment to the section or value selected by path.protected final voidsetFormattedComment(KeyTree.Node node, String comment, CommentType type) protected final voidsetRawComment(KeyTree.Node node, String comment, CommentType type) 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
-
keyTree
-
NO_COMMENTS
-
-
Constructor Details
-
YamlCommentMapper
-
YamlCommentMapper
-
-
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
-
setFormattedComment
-
setRawComment
-
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
-
getComment
-
getRawComment
-
getRawComment
-
removeComment
-
removeComment
-
getKeyTree
-
options
-
getNode
-
getPriorityNode
-
getOrAddNode
-
clearNodeIfNoComments
-
clearNode
-