public class TypeSolverBuilder extends Object
new TypeSolverBuilder()
.withCurrentJRE()
.build()
Example 2:
Solve JRE and types defined in foo.jar:
new TypeSolverBuilder()
.withCurrentJRE()
.withJAR("foo.jar")
.build()
| Constructor and Description |
|---|
TypeSolverBuilder() |
| Modifier and Type | Method and Description |
|---|---|
TypeSolver |
build()
Convert the current build into a valid
TypeSolver. |
TypeSolverBuilder |
with(@NonNull TypeSolver typeSolver)
Append a costum type solver to the build.
|
TypeSolverBuilder |
withAAR(@NonNull File pathToAar)
Allow the type solver to resolve types that are
defined in a AAR file.
|
TypeSolverBuilder |
withAAR(@NonNull Path pathToAar)
Allow the type solver to resolve types that are
defined in a AAR file.
|
TypeSolverBuilder |
withAAR(@NonNull String pathToAar)
Allow the type solver to resolve types that are
defined in a AAR file.
|
TypeSolverBuilder |
withClassLoader(@NonNull ClassLoader classLoader)
Allow the type solver to resolve types using
the provided
ClassLoader. |
TypeSolverBuilder |
withCurrentClassloader()
Allow the type solver to resolve types that are
defined in the current
ClassLoader. |
TypeSolverBuilder |
withCurrentJRE()
Allow the type solver to resolve types that are
defined in the current Java Runtime Environment (JRE).
|
TypeSolverBuilder |
withJAR(@NonNull File pathToJar)
Allow the type solver to resolve types that are
defined in a JAR file.
|
TypeSolverBuilder |
withJAR(@NonNull Path pathToJar)
Allow the type solver to resolve types that are
defined in a JAR file.
|
TypeSolverBuilder |
withJAR(@NonNull String pathToJar)
Allow the type solver to resolve types that are
defined in a JAR file.
|
TypeSolverBuilder |
withSourceCode(@NonNull File pathToSourceCode)
Allow the type solver to resolve types using
external source code.
|
TypeSolverBuilder |
withSourceCode(@NonNull Path pathToSourceCode)
Allow the type solver to resolve types using
external source code.
|
TypeSolverBuilder |
withSourceCode(@NonNull String pathToSourceCode)
Allow the type solver to resolve types using
external source code.
|
public TypeSolverBuilder with(@NonNull TypeSolver typeSolver)
typeSolver - The type solver to be added.public TypeSolverBuilder withCurrentJRE()
ReflectionTypeSolverpublic TypeSolverBuilder withCurrentClassloader()
ClassLoader.
Some examples of those types are:
ReflectionTypeSolverpublic TypeSolverBuilder withJAR(@NonNull Path pathToJar) throws IOException
pathToJar - The path to the jar file.IOException - If an I/O exception occurs while reading the Jar.JarTypeSolverpublic TypeSolverBuilder withJAR(@NonNull File pathToJar) throws IOException
pathToJar - The jar file.IOException - If an I/O exception occurs while reading the Jar.JarTypeSolverpublic TypeSolverBuilder withJAR(@NonNull String pathToJar) throws IOException
pathToJar - The path to the jar file.IOException - If an I/O exception occurs while reading the Jar.JarTypeSolverpublic TypeSolverBuilder withAAR(@NonNull Path pathToAar) throws IOException
pathToAar - The path to the AAR file.IOException - If an I/O exception occurs while reading the AAR.AarTypeSolverpublic TypeSolverBuilder withAAR(@NonNull File pathToAar) throws IOException
pathToAar - The AAR file.IOException - If an I/O exception occurs while reading the AAR.AarTypeSolverpublic TypeSolverBuilder withAAR(@NonNull String pathToAar) throws IOException
pathToAar - The path to the AAR file.IOException - If an I/O exception occurs while reading the AAR.AarTypeSolverpublic TypeSolverBuilder withSourceCode(@NonNull Path pathToSourceCode)
pathToSourceCode - The path to the source code.JavaParserTypeSolverpublic TypeSolverBuilder withSourceCode(@NonNull File pathToSourceCode)
pathToSourceCode - The source code file.JavaParserTypeSolverpublic TypeSolverBuilder withSourceCode(@NonNull String pathToSourceCode)
pathToSourceCode - The path to the source code.JavaParserTypeSolverpublic TypeSolverBuilder withClassLoader(@NonNull ClassLoader classLoader)
ClassLoader.classLoader - The class loader to be registered.ClassLoaderTypeSolverpublic TypeSolver build()
TypeSolver.IllegalStateException - if no build configuration is provided.Copyright © 2007–2024. All rights reserved.