Class JavaParserTypeSolver

  • All Implemented Interfaces:
    TypeSolver

    public class JavaParserTypeSolver
    extends java.lang.Object
    implements TypeSolver
    Defines a directory containing source code that should be used for solving symbols. The directory must correspond to the root package of the files within.
    • Constructor Detail

      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.io.File srcDir)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.lang.String srcDir)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.nio.file.Path srcDir)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.io.File srcDir,
                                    ParserConfiguration parserConfiguration)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.lang.String srcDir,
                                    ParserConfiguration parserConfiguration)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.nio.file.Path srcDir,
                                    ParserConfiguration parserConfiguration)
      • JavaParserTypeSolver

        public JavaParserTypeSolver​(java.nio.file.Path srcDir,
                                    ParserConfiguration parserConfiguration,
                                    long cacheSizeLimit)
        Parameters:
        srcDir - is the source code directory for the type solver.
        parserConfiguration - is the configuration the solver should use when inspecting source code files.
        cacheSizeLimit - is an optional size limit to the internal caches used by this solver. Be advised that setting the size too low might lead to noticeable performance degradation. However, using a size limit is advised when solving symbols in large code sources. In such cases, internal caches might consume large amounts of heap space.
    • Method Detail

      • BuildCache

        private <TKey,​TValue> Cache<TKey,​TValue> BuildCache​(long cacheSizeLimit)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parse

        private java.util.Optional<CompilationUnit> parse​(java.nio.file.Path srcFile)
      • parseDirectory

        private java.util.List<CompilationUnit> parseDirectory​(java.nio.file.Path srcDirectory)
        Note that this parse only files directly contained in this directory. It does not traverse recursively all children directory.
      • parseDirectoryRecursively

        private java.util.List<CompilationUnit> parseDirectoryRecursively​(java.nio.file.Path srcDirectory)
      • parseDirectory

        private java.util.List<CompilationUnit> parseDirectory​(java.nio.file.Path srcDirectory,
                                                               boolean recursively)