Class Editor.EditorCommentBuilder

java.lang.Object
eu.maveniverse.domtrip.Editor.EditorCommentBuilder
Enclosing class:
Editor

public static class Editor.EditorCommentBuilder extends Object
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 Details

    • to

      Sets the parent node for this comment.
      Parameters:
      parent - the parent node
      Returns:
      this builder for method chaining
    • withContent

      public Editor.EditorCommentBuilder withContent(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