Class PropertiesCommentService
java.lang.Object
org.openrewrite.internal.CommentService
org.openrewrite.properties.service.PropertiesCommentService
@Incubating(since="8.86.0")
public class PropertiesCommentService
extends org.openrewrite.internal.CommentService
CommentService for the .properties LST model. Like XML, a properties comment is a
real Properties.Comment sibling node within the Properties.File content rather than
prefix metadata, so the service walks up to the file and edits the run of comment siblings that
immediately precede the element. The multiline flag and any explicit suffix are ignored,
since a properties comment is always a single # line.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeaddComment(org.openrewrite.Cursor cursor, String text, boolean multiline, org.openrewrite.trait.Comments.Placement placement) getComments(org.openrewrite.Cursor cursor) org.openrewrite.TreeremoveComment(org.openrewrite.Cursor cursor, String text) org.openrewrite.TreereplaceComment(org.openrewrite.Cursor cursor, String existingText, String newText) Methods inherited from class org.openrewrite.internal.CommentService
addComment, addComment, equivalent, hasComment, hasEquivalentComment
-
Constructor Details
-
PropertiesCommentService
public PropertiesCommentService()
-
-
Method Details
-
getComments
- Specified by:
getCommentsin classorg.openrewrite.internal.CommentService
-
addComment
public org.openrewrite.Tree addComment(org.openrewrite.Cursor cursor, String text, boolean multiline, org.openrewrite.trait.Comments.Placement placement) - Specified by:
addCommentin classorg.openrewrite.internal.CommentService
-
removeComment
- Specified by:
removeCommentin classorg.openrewrite.internal.CommentService
-
replaceComment
public org.openrewrite.Tree replaceComment(org.openrewrite.Cursor cursor, String existingText, String newText) - Specified by:
replaceCommentin classorg.openrewrite.internal.CommentService
-