Class SymbolSolver

  • All Implemented Interfaces:
    com.github.javaparser.resolution.Solver

    public class SymbolSolver
    extends Object
    implements com.github.javaparser.resolution.Solver
    Author:
    Federico Tomassetti
    • Constructor Summary

      Constructors 
      Constructor Description
      SymbolSolver​(com.github.javaparser.resolution.TypeSolver typeSolver)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      com.github.javaparser.resolution.types.ResolvedType classToResolvedType​(Class<?> clazz)
      Convert a Class into the corresponding ResolvedType.
      com.github.javaparser.resolution.MethodUsage solveMethod​(String methodName, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, com.github.javaparser.ast.Node node)  
      com.github.javaparser.resolution.MethodUsage solveMethod​(String methodName, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, com.github.javaparser.resolution.Context context)  
      com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol​(String name, com.github.javaparser.ast.Node node)  
      com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol​(String name, com.github.javaparser.resolution.Context context)  
      Optional<com.github.javaparser.resolution.model.Value> solveSymbolAsValue​(String name, com.github.javaparser.ast.Node node)  
      Optional<com.github.javaparser.resolution.model.Value> solveSymbolAsValue​(String name, com.github.javaparser.resolution.Context context)  
      com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbolInType​(com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration typeDeclaration, String name)
      Solve any possible visible symbols including: fields, internal types, type variables, the type itself or its containers.
      com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration solveType​(com.github.javaparser.ast.type.Type type)  
      com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveType​(String name, com.github.javaparser.ast.Node node)  
      com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveType​(String name, com.github.javaparser.resolution.Context context)  
      com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveTypeInType​(com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration typeDeclaration, String name)
      Deprecated.
      Similarly to solveType this should eventually disappear as the symbol resolution logic should be more general and do not be specific to JavaParser classes like in this case.
      com.github.javaparser.resolution.types.ResolvedType solveTypeUsage​(String name, com.github.javaparser.resolution.Context context)  
    • Constructor Detail

      • SymbolSolver

        public SymbolSolver​(com.github.javaparser.resolution.TypeSolver typeSolver)
    • Method Detail

      • solveSymbol

        public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol​(String name,
                                                                                                                                                                    com.github.javaparser.resolution.Context context)
        Specified by:
        solveSymbol in interface com.github.javaparser.resolution.Solver
      • solveSymbol

        public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol​(String name,
                                                                                                                                                                    com.github.javaparser.ast.Node node)
        Specified by:
        solveSymbol in interface com.github.javaparser.resolution.Solver
      • solveSymbolAsValue

        public Optional<com.github.javaparser.resolution.model.Value> solveSymbolAsValue​(String name,
                                                                                         com.github.javaparser.resolution.Context context)
        Specified by:
        solveSymbolAsValue in interface com.github.javaparser.resolution.Solver
      • solveSymbolAsValue

        public Optional<com.github.javaparser.resolution.model.Value> solveSymbolAsValue​(String name,
                                                                                         com.github.javaparser.ast.Node node)
        Specified by:
        solveSymbolAsValue in interface com.github.javaparser.resolution.Solver
      • solveType

        public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveType​(String name,
                                                                                                                                                                 com.github.javaparser.resolution.Context context)
        Specified by:
        solveType in interface com.github.javaparser.resolution.Solver
      • solveType

        public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveType​(String name,
                                                                                                                                                                 com.github.javaparser.ast.Node node)
        Specified by:
        solveType in interface com.github.javaparser.resolution.Solver
      • solveMethod

        public com.github.javaparser.resolution.MethodUsage solveMethod​(String methodName,
                                                                        List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes,
                                                                        com.github.javaparser.resolution.Context context)
        Specified by:
        solveMethod in interface com.github.javaparser.resolution.Solver
      • solveMethod

        public com.github.javaparser.resolution.MethodUsage solveMethod​(String methodName,
                                                                        List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes,
                                                                        com.github.javaparser.ast.Node node)
        Specified by:
        solveMethod in interface com.github.javaparser.resolution.Solver
      • solveType

        public com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration solveType​(com.github.javaparser.ast.type.Type type)
        Specified by:
        solveType in interface com.github.javaparser.resolution.Solver
      • solveTypeUsage

        public com.github.javaparser.resolution.types.ResolvedType solveTypeUsage​(String name,
                                                                                  com.github.javaparser.resolution.Context context)
        Specified by:
        solveTypeUsage in interface com.github.javaparser.resolution.Solver
      • solveSymbolInType

        public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbolInType​(com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration typeDeclaration,
                                                                                                                                                                          String name)
        Solve any possible visible symbols including: fields, internal types, type variables, the type itself or its containers.

        It should contain its own private fields but not inherited private fields.

        Specified by:
        solveSymbolInType in interface com.github.javaparser.resolution.Solver
      • solveTypeInType

        @Deprecated
        public com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveTypeInType​(com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration typeDeclaration,
                                                                                                                                                             String name)
        Deprecated.
        Similarly to solveType this should eventually disappear as the symbol resolution logic should be more general and do not be specific to JavaParser classes like in this case.
        Try to solve a symbol just in the declaration, it does not delegate to the container.
        Specified by:
        solveTypeInType in interface com.github.javaparser.resolution.Solver
      • classToResolvedType

        public com.github.javaparser.resolution.types.ResolvedType classToResolvedType​(Class<?> clazz)
        Convert a Class into the corresponding ResolvedType.
        Specified by:
        classToResolvedType in interface com.github.javaparser.resolution.Solver
        Parameters:
        clazz - The class to be converted.
        Returns:
        The class resolved.