Class JavaCommentsHelper

    • Field Detail

      • lineSeparator

        private final java.lang.String lineSeparator
      • LINE_COMMENT_MISSING_SPACE_PREFIX

        private static final java.util.regex.Pattern LINE_COMMENT_MISSING_SPACE_PREFIX
    • Constructor Detail

      • JavaCommentsHelper

        public JavaCommentsHelper​(java.lang.String lineSeparator,
                                  JavaFormatterOptions options)
    • Method Detail

      • rewrite

        public java.lang.String rewrite​(Input.Tok tok,
                                        int maxWidth,
                                        int column0)
        Description copied from interface: CommentsHelper
        Try to rewrite comments, returning rewritten text.
        Specified by:
        rewrite in interface CommentsHelper
        Parameters:
        tok - the comment's tok
        maxWidth - the line length for the output
        column0 - the current column
        Returns:
        the rewritten comment
      • preserveIndentation

        private java.lang.String preserveIndentation​(java.util.List<java.lang.String> lines,
                                                     int column0)
      • indentLineComments

        private java.lang.String indentLineComments​(java.util.List<java.lang.String> lines,
                                                    int column0)
      • wrapLineComments

        private java.util.List<java.lang.String> wrapLineComments​(java.util.List<java.lang.String> lines,
                                                                  int column0)
      • indentJavadoc

        private java.lang.String indentJavadoc​(java.util.List<java.lang.String> lines,
                                               int column0)
      • javadocShaped

        private static boolean javadocShaped​(java.util.List<java.lang.String> lines)