Class JavadocParser


  • class JavadocParser
    extends java.lang.Object
    The class responsible for parsing the content of JavadocComments and producing JavadocDocuments. The Javadoc specification.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.regex.Pattern BLOCK_PATTERN  
      private static java.lang.String BLOCK_TAG_PREFIX  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavadocParser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<java.lang.String> cleanLines​(java.lang.String content, boolean isMarkdownComment)  
      private static boolean isABlockLine​(java.lang.String line)  
      static Javadoc parse​(JavadocComment comment)  
      static Javadoc parse​(java.lang.String commentContent)  
      static Javadoc parse​(java.lang.String commentContent, boolean isMarkdownComment)  
      private static JavadocBlockTag parseBlockTag​(java.lang.String line)  
      (package private) static int startsWithAsteriskOrMdSlash​(java.lang.String line)
      Given a line in a block or markdown comment, this method finds the index of the * or / at the start of the line.
      private static java.lang.String trimRight​(java.lang.String string)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BLOCK_TAG_PREFIX

        private static java.lang.String BLOCK_TAG_PREFIX
      • BLOCK_PATTERN

        private static java.util.regex.Pattern BLOCK_PATTERN
    • Constructor Detail

      • JavadocParser

        JavadocParser()
    • Method Detail

      • parse

        public static Javadoc parse​(java.lang.String commentContent)
      • parse

        public static Javadoc parse​(java.lang.String commentContent,
                                    boolean isMarkdownComment)
      • parseBlockTag

        private static JavadocBlockTag parseBlockTag​(java.lang.String line)
      • isABlockLine

        private static boolean isABlockLine​(java.lang.String line)
      • trimRight

        private static java.lang.String trimRight​(java.lang.String string)
      • cleanLines

        private static java.util.List<java.lang.String> cleanLines​(java.lang.String content,
                                                                   boolean isMarkdownComment)
      • startsWithAsteriskOrMdSlash

        static int startsWithAsteriskOrMdSlash​(java.lang.String line)
        Given a line in a block or markdown comment, this method finds the index of the * or / at the start of the line. For markdown comments where lines start with ///, this would be the index of the third /. This is used to strip the relevant prefix string when cleaning lines as part of the Javadoc parsing process. It is made visible for testing