Package eu.maveniverse.domtrip
Class Editor.EditorCommentBuilder
- java.lang.Object
-
- eu.maveniverse.domtrip.Editor.EditorCommentBuilder
-
- Enclosing class:
- Editor
public static class Editor.EditorCommentBuilder extends java.lang.ObjectBuilder for creating comments within the Editor context.This builder integrates with the Editor's whitespace management and automatically adds the created comment to the specified parent.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Commentbuild()Builds and adds the comment to the document.Editor.EditorCommentBuilderto(ContainerNode parent)Sets the parent node for this comment.Editor.EditorCommentBuilderwithContent(java.lang.String content)Sets the content of this comment.
-
-
-
Method Detail
-
to
public Editor.EditorCommentBuilder to(ContainerNode parent)
Sets the parent node for this comment.- Parameters:
parent- the parent node- Returns:
- this builder for method chaining
-
withContent
public Editor.EditorCommentBuilder withContent(java.lang.String content)
Sets the content of this comment.- Parameters:
content- the comment content- Returns:
- this builder for method chaining
-
build
public Comment build() throws DomTripException
Builds and adds the comment to the document.- Returns:
- the created and added comment
- Throws:
DomTripException- if the comment cannot be added
-
-