Interface Commentable
- All Known Implementing Classes:
SimpleYamlImplementation,SnakeYamlCommentMapper,SnakeYamlImplementation,YamlCommentDumper,YamlCommentMapper,YamlCommentParser,YamlCommentReader,YamlFile,YamlImplementationCommentable
public interface Commentable
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetComment(String path) Retrieve the block comment of the section or value selected by path.getComment(String path, CommentType type) Retrieve the comment of the section or value selected by path.default voidsetComment(String path, String comment) Set a block comment above the section or value selected by path.voidsetComment(String path, String comment, CommentType type) Set a comment to the section or value selected by path.
-
Method Details
-
setComment
Set a comment to the section or value selected by path. Comment will be indented automatically. Multi-line comments can be provided using \n character.- Parameters:
path- path of desired section or keycomment- the comment to add, # symbol is not neededtype- either above (BLOCK) or SIDE
-
setComment
Set a block comment above the section or value selected by path. Comment will be indented automatically. Multi-line comments can be provided using \n character.- Parameters:
path- path of desired section or keycomment- the comment to add, # symbol is not needed
-
getComment
Retrieve the comment of the section or value selected by path.- 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
Retrieve the block comment of the section or value selected by path.- Parameters:
path- path of desired section or key- Returns:
- the block comment of the section or value selected by path, or null if that path does not have any comment of type block
-