Class Editor.EditorCommentBuilder
java.lang.Object
eu.maveniverse.domtrip.Editor.EditorCommentBuilder
- Enclosing class:
Editor
Builder 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
Modifier and TypeMethodDescriptionbuild()Builds and adds the comment to the document.to(ContainerNode parent) Sets the parent node for this comment.withContent(String content) Sets the content of this comment.
-
Method Details
-
to
Sets the parent node for this comment.- Parameters:
parent- the parent node- Returns:
- this builder for method chaining
-
withContent
Sets the content of this comment.- Parameters:
content- the comment content- Returns:
- this builder for method chaining
-
build
Builds and adds the comment to the document.- Returns:
- the created and added comment
- Throws:
DomTripException- if the comment cannot be added
-