Class TreeWalker

    • Constructor Detail

      • TreeWalker

        public TreeWalker()
        Creates a new TreeWalker instance.
    • Method Detail

      • setTabWidth

        public void setTabWidth​(int tabWidth)
        Sets tab width.
        Parameters:
        tabWidth - the distance between tab stops
      • setClassLoader

        public void setClassLoader​(ClassLoader classLoader)
        Sets classLoader to load class.
        Parameters:
        classLoader - class loader to resolve classes with.
      • setModuleFactory

        public void setModuleFactory​(ModuleFactory moduleFactory)
        Sets the module factory for creating child modules (Checks).
        Parameters:
        moduleFactory - the factory
      • finishLocalSetup

        public void finishLocalSetup()
        Description copied from class: AutomaticBean
        Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.

        The default implementation does nothing.

        Overrides:
        finishLocalSetup in class AutomaticBean
      • parse

        public static DetailAST parse​(FileContents contents)
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException
        Static helper method to parses a Java source file.
        Parameters:
        contents - contains the contents of the file
        Returns:
        the root of the AST
        Throws:
        antlr.TokenStreamException - if lexing failed
        antlr.RecognitionException - if parsing failed
      • parseWithComments

        public static DetailAST parseWithComments​(FileContents contents)
                                           throws antlr.RecognitionException,
                                                  antlr.TokenStreamException
        Parses Java source file. Result AST contains comment nodes.
        Parameters:
        contents - source file content
        Returns:
        DetailAST tree
        Throws:
        antlr.RecognitionException - if parser failed
        antlr.TokenStreamException - if lexer failed