public class ClassOrInterfaceDeclarationContext extends AbstractJavaParserContext<ClassOrInterfaceDeclaration>
typeSolver, wrappedNode
Constructor and Description |
---|
ClassOrInterfaceDeclarationContext(ClassOrInterfaceDeclaration wrappedNode,
TypeSolver typeSolver) |
Modifier and Type | Method and Description |
---|---|
List<ResolvedFieldDeclaration> |
fieldsExposedToChild(Node child)
The fields that are declared and in this immediate context made visible to a given child.
|
SymbolReference<ResolvedConstructorDeclaration> |
solveConstructor(List<ResolvedType> argumentsTypes)
We find the method declaration which is the best match for the given name and list of typeParametersValues.
|
Optional<ResolvedType> |
solveGenericType(String name)
Default to no generics available in this context, delegating solving to the parent context.
|
SymbolReference<ResolvedMethodDeclaration> |
solveMethod(String name,
List<ResolvedType> argumentsTypes,
boolean staticOnly)
We find the method declaration which is the best match for the given name and list of typeParametersValues.
|
SymbolReference<? extends ResolvedValueDeclaration> |
solveSymbol(String name)
Used where a symbol is being used (e.g. solving
x when used as an argument doubleThis(x) , or calculation return x * 2; ). |
Optional<Value> |
solveSymbolAsValue(String name)
Used where a symbol is being used (e.g. solving
x when used as an argument doubleThis(x) , or calculation return x * 2; ). |
SymbolReference<ResolvedTypeDeclaration> |
solveType(String name,
List<ResolvedType> typeArguments)
Method used to solve a name with an expected list of type arguments.
|
equals, findTypeDeclarations, getParent, getScope, getWrappedNode, hashCode, isQualifiedName, solveSymbolInParentContext, solveWith, solveWithAsValue
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
fieldDeclarationInScope, localVariableDeclarationInScope, localVariablesExposedToChild, negatedPatternExprsExposedFromChildren, parameterDeclarationInScope, parametersExposedToChild, patternExprInScope, patternExprsExposedFromChildren, patternExprsExposedToChild, solveGenericTypeInParentContext, solveMethodAsUsage, solveMethodInParentContext, solveSymbolAsValueInParentContext, solveType, solveTypeInParentContext, solveTypeInParentContext
public ClassOrInterfaceDeclarationContext(ClassOrInterfaceDeclaration wrappedNode, TypeSolver typeSolver)
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name)
Context
x
when used as an argument doubleThis(x)
, or calculation return x * 2;
).name
- the variable / reference / identifier used.public Optional<Value> solveSymbolAsValue(String name)
Context
x
when used as an argument doubleThis(x)
, or calculation return x * 2;
).name
- the variable / reference / identifier used.public Optional<ResolvedType> solveGenericType(String name)
Context
name
- For example, solving T
within class Foo<T> {}
orpublic SymbolReference<ResolvedTypeDeclaration> solveType(String name, List<ResolvedType> typeArguments)
Context
Context.solveType(String)
by taking the type arguments in consideration.
For example, lets imagine that we have a project containing the following classes:
name
- The name to be solved.typeArguments
- The list of expected type arguments.public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
Context
public SymbolReference<ResolvedConstructorDeclaration> solveConstructor(List<ResolvedType> argumentsTypes)
Context
public List<ResolvedFieldDeclaration> fieldsExposedToChild(Node child)
Context
Copyright © 2007–2022. All rights reserved.