public class JavaSymbolSolver extends Object implements SymbolResolver
An instance of this class should be created once and then injected in all the CompilationUnit for which we
want to enable symbol resolution. To do so the method inject can be used, or you can use
ParserConfiguration.setSymbolResolver(SymbolResolver)
and the parser will do the
injection for you.
Constructor and Description |
---|
JavaSymbolSolver(TypeSolver typeSolver) |
Modifier and Type | Method and Description |
---|---|
ResolvedType |
calculateType(Expression expression) |
void |
inject(CompilationUnit destination)
Register this SymbolResolver into a CompilationUnit, so that symbol resolution becomes available to
all nodes part of the CompilationUnit.
|
<T> T |
resolveDeclaration(Node node,
Class<T> resultClass) |
<T> T |
toResolvedType(Type javaparserType,
Class<T> resultClass) |
public JavaSymbolSolver(TypeSolver typeSolver)
public void inject(CompilationUnit destination)
public <T> T resolveDeclaration(Node node, Class<T> resultClass)
resolveDeclaration
in interface SymbolResolver
public <T> T toResolvedType(Type javaparserType, Class<T> resultClass)
toResolvedType
in interface SymbolResolver
public ResolvedType calculateType(Expression expression)
calculateType
in interface SymbolResolver
Copyright © 2007–2021. All rights reserved.