Interface CommentHandler

  • All Known Implementing Classes:
    CommentHandlers

    @Immutable
    public interface CommentHandler
    Extracts comments from a buffered reader or collection of lines.
    Since:
    4.0.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String extractHeader​(java.io.BufferedReader reader)
      Defines the handlers behaviour for reading comments.
      java.util.stream.Stream<java.lang.String> toComment​(java.util.stream.Stream<java.lang.String> lines)
      Converts the specified lines into a comment.
    • Method Detail

      • extractHeader

        @Nullable java.lang.String extractHeader​(java.io.BufferedReader reader)
                                          throws java.io.IOException
        Defines the handlers behaviour for reading comments.
        Parameters:
        reader - reader to get input from
        Returns:
        an extracted comment, if any
        Throws:
        java.io.IOException - if any IO error occurs in the process
        Since:
        4.0.0
      • toComment

        java.util.stream.Stream<java.lang.String> toComment​(java.util.stream.Stream<java.lang.String> lines)
        Converts the specified lines into a comment.
        Parameters:
        lines - lines to make a comment
        Returns:
        transformed lines as a stream
        Since:
        4.0.0