Class BaseBlockComment

All Implemented Interfaces:
io.github.mmm.code.api.comment.CodeBlockComment, io.github.mmm.code.api.comment.CodeComment, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.statement.CodeStatement, Iterable<String>

public class BaseBlockComment extends BaseComment implements io.github.mmm.code.api.comment.CodeBlockComment
Base implementation of CodeBlockComment.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Field Details

    • EMPTY_COMMENT

      public static final BaseBlockComment EMPTY_COMMENT
      An empty comment instance.
  • Constructor Details

    • BaseBlockComment

      public BaseBlockComment(io.github.mmm.code.api.comment.CodeComment comment)
      The constructor.
      Parameters:
      comment - an existing instance of CodeComment to copy/convert to a block comment.
    • BaseBlockComment

      public BaseBlockComment(List<String> commentLines)
      The constructor.
      Parameters:
      commentLines - the comment lines.
    • BaseBlockComment

      public BaseBlockComment(String... commentLines)
      The constructor.
      Parameters:
      commentLines - the comment lines.
  • Method Details

    • getCommentLines

      public List<String> getCommentLines()
      Specified by:
      getCommentLines in interface io.github.mmm.code.api.comment.CodeBlockComment
      Specified by:
      getCommentLines in interface io.github.mmm.code.api.comment.CodeComment
    • doWrite

      protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException
      Specified by:
      doWrite in class BaseItem
      Parameters:
      sink - the Appendable where to append the code from this CodeItem.
      newline - the newline String.
      defaultIndent - the String used for indentation (e.g. a number of spaces to insert per indent level).
      currentIndent - the current indent (number of spaces). Initially the empty string (""). Before a recursion the defaultIndent will be appended.
      language - the CodeLanguage to use.
      Throws:
      IOException - if thrown by Appendable.
      See Also:
      • CodeItem.write(Appendable, String, String)