me.tomassetti.symbolsolver.javassistmodel.contexts.JavassistMethodContext Maven / Gradle / Ivy
The newest version!
package me.tomassetti.symbolsolver.javassistmodel.contexts;
import javassist.CtClass;
import javassist.CtMethod;
import me.tomassetti.symbolsolver.model.declarations.MethodDeclaration;
import me.tomassetti.symbolsolver.model.declarations.TypeDeclaration;
import me.tomassetti.symbolsolver.model.declarations.ValueDeclaration;
import me.tomassetti.symbolsolver.model.usages.typesystem.Type;
import me.tomassetti.symbolsolver.core.resolution.Context;
import me.tomassetti.symbolsolver.model.resolution.SymbolReference;
import me.tomassetti.symbolsolver.model.resolution.TypeSolver;
import java.util.List;
import java.util.Optional;
@Deprecated
public class JavassistMethodContext implements Context {
private CtMethod wrappedNode;
public JavassistMethodContext(CtMethod wrappedNode) {
this.wrappedNode = wrappedNode;
}
@Override
public SymbolReference solveSymbol(String name, TypeSolver typeSolver) {
throw new UnsupportedOperationException();
}
@Override
public SymbolReference solveType(String name, TypeSolver typeSolver) {
throw new UnsupportedOperationException();
}
@Override
public Optional solveGenericType(String name, TypeSolver typeSolver) {
// TODO consider generic typeParametersValues of the method
return getParent().solveGenericType(name, typeSolver);
}
@Override
public SymbolReference solveMethod(String name, List argumentsTypes, TypeSolver typeSolver) {
throw new UnsupportedOperationException();
}
@Override
public Context getParent() {
CtClass ctClass = wrappedNode.getDeclaringClass();
return new JavassistClassContext(ctClass);
}
}