package com.buschmais.jqassistant.core.scanner.impl.visitor;
import com.buschmais.jqassistant.core.model.api.descriptor.MethodDescriptor;
import com.buschmais.jqassistant.core.model.api.descriptor.ParameterDescriptor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.signature.SignatureVisitor;
/**
* Created with IntelliJ IDEA.
* User: Dirk Mahler
* Date: 03.08.13
* Time: 09:17
* To change this template use File | Settings | File Templates.
*/
public class MethodSignatureVisitor extends SignatureVisitor {
private MethodDescriptor methodDescriptor;
private VisitorHelper visitorHelper;
private int parameterIndex = 0;
MethodSignatureVisitor(MethodDescriptor methodDescriptor, VisitorHelper visitorHelper) {
super(Opcodes.ASM4);
this.methodDescriptor = methodDescriptor;
this.visitorHelper = visitorHelper;
}
@Override
public void visitFormalTypeParameter(String name) {
}
@Override
public SignatureVisitor visitClassBound() {
return new DependentTypeSignatureVisitor(methodDescriptor, visitorHelper);
}
@Override
public SignatureVisitor visitInterfaceBound() {
return new DependentTypeSignatureVisitor(methodDescriptor, visitorHelper);
}
@Override
public SignatureVisitor visitSuperclass() {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public SignatureVisitor visitInterface() {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public SignatureVisitor visitParameterType() {
ParameterDescriptor parameterDescriptor = visitorHelper.getParameterDescriptor(methodDescriptor, parameterIndex);
parameterIndex++;
return new DependentTypeSignatureVisitor(parameterDescriptor, visitorHelper);
}
@Override
public SignatureVisitor visitReturnType() {
return new DependentTypeSignatureVisitor(methodDescriptor, visitorHelper);
}
@Override
public SignatureVisitor visitExceptionType() {
return new DependentTypeSignatureVisitor(methodDescriptor, visitorHelper);
}
@Override
public void visitBaseType(char descriptor) {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public void visitTypeVariable(String name) {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public SignatureVisitor visitArrayType() {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public void visitClassType(String name) {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public void visitInnerClassType(String name) {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public void visitTypeArgument() {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public SignatureVisitor visitTypeArgument(char wildcard) {
throw new UnsupportedOperationException("Method is not implemented.");
}
@Override
public void visitEnd() {
}
}