A Java symbol solver that resolves type references and declarations in Java code by analyzing JavaParser ASTs.
JavaSymbolSolver is a Java library that resolves symbols and types in Java source code by analyzing Abstract Syntax Trees (ASTs) generated by JavaParser. It solves the problem of determining which declaration a symbol refers to and inferring expression types, which is essential for building code analysis, refactoring, or documentation tools.
Java developers and tool builders who need semantic analysis capabilities, such as those building IDEs, linters, code generators, or static analysis tools that require accurate type and symbol resolution.
Developers choose JavaSymbolSolver because it seamlessly integrates with JavaParser, provides robust support for modern Java features, and offers a flexible TypeSolver architecture that can handle source files, JAR dependencies, and reflection-based resolution.
old repository --> this is now integrated in https://github.com/javaparser/javaparser
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The README explicitly states it supports all Java 8 features like lambdas, generics, and type inference, ensuring compatibility with modern codebases.
Provides multiple TypeSolver implementations (JavaParserTypeSolver, JarTypeSolver, etc.) for resolving symbols from source directories, JARs, or reflection, as detailed in the configuration examples.
Used in commercial products like Coati, indicating it's battle-tested and actively maintained by the JavaParser team, as mentioned in the key features.
Built on top of JavaParser from the same team, enabling easy enhancement of ASTs with semantic information, as described in the 'How this complement JavaParser?' section.
Setting up requires instantiating and combining multiple TypeSolvers, which can be cumbersome and error-prone for simple use cases, as shown in the code example with CombinedTypeSolver.
The README notes the best source is a paid book, and more free tutorials are 'planned,' leaving developers reliant on sparse articles or the integrated JavaParser project for guidance.
Development has moved to the JavaParser project, causing potential confusion about issue reporting and updates, as highlighted at the top of the README with a warning.
Semantic analysis adds computational overhead, and no performance optimizations are highlighted, which could impact large codebases or real-time applications.