Search in sources :

Example 1 with JavaSymbolSolver

use of com.github.javaparser.symbolsolver.JavaSymbolSolver in project javaparser by javaparser.

the class SymbolSolverQuickSetupTest method setUp.

@Before
public void setUp() throws IOException {
    SymbolSolverQuickSetup ssr = new SymbolSolverQuickSetup(root);
    TypeSolver typeSolver = ssr.walk();
    parserConfiguration.setSymbolResolver(new JavaSymbolSolver(typeSolver));
}
Also used : TypeSolver(com.github.javaparser.symbolsolver.model.resolution.TypeSolver) JavaSymbolSolver(com.github.javaparser.symbolsolver.JavaSymbolSolver) Before(org.junit.Before)

Example 2 with JavaSymbolSolver

use of com.github.javaparser.symbolsolver.JavaSymbolSolver in project javaparser by javaparser.

the class JavaParserFacadeResolutionTest method parseWithTypeSolver.

private CompilationUnit parseWithTypeSolver(String code) {
    TypeSolver typeSolver = new ReflectionTypeSolver();
    ParserConfiguration parserConfiguration = new ParserConfiguration();
    parserConfiguration.setSymbolResolver(new JavaSymbolSolver(typeSolver));
    JavaParser javaParser = new JavaParser(parserConfiguration);
    return javaParser.parse(ParseStart.COMPILATION_UNIT, new StringProvider(code)).getResult().get();
}
Also used : TypeSolver(com.github.javaparser.symbolsolver.model.resolution.TypeSolver) ReflectionTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver) JavaSymbolSolver(com.github.javaparser.symbolsolver.JavaSymbolSolver) ReflectionTypeSolver(com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver)

Aggregations

JavaSymbolSolver (com.github.javaparser.symbolsolver.JavaSymbolSolver)2 TypeSolver (com.github.javaparser.symbolsolver.model.resolution.TypeSolver)2 ReflectionTypeSolver (com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver)1 Before (org.junit.Before)1