return new FieldVisitor(fieldDescriptor, visitorHelper);
}
@Override
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
MethodDescriptor methodDescriptor = visitorHelper.getMethodDescriptor(typeDescriptor, SignatureHelper.getMethodSignature(name, desc));
typeDescriptor.addDeclaredMethod(methodDescriptor);
methodDescriptor.setName(name);
setModifiers(access, methodDescriptor);
if (hasFlag(access, Opcodes.ACC_ABSTRACT)) {
methodDescriptor.setAbstract(Boolean.TRUE);
}
if (hasFlag(access, Opcodes.ACC_NATIVE)) {
methodDescriptor.setNative(Boolean.TRUE);
}
if (signature == null) {
String returnType = SignatureHelper.getType(Type.getReturnType(desc));
methodDescriptor.setReturns(visitorHelper.getTypeDescriptor(returnType));
org.objectweb.asm.Type[] types = org.objectweb.asm.Type.getArgumentTypes(desc);
for (int i = 0; i < types.length; i++) {
ParameterDescriptor parameterDescriptor = visitorHelper.addParameterDescriptor(methodDescriptor, i);
String parameterType = SignatureHelper.getType(types[i]);
parameterDescriptor.setType(visitorHelper.getTypeDescriptor(parameterType));
}
} else {
new SignatureReader(signature).accept(new MethodSignatureVisitor(methodDescriptor, visitorHelper));
}
for (int i = 0; exceptions != null && i < exceptions.length; i++) {
TypeDescriptor exception = visitorHelper.getTypeDescriptor(SignatureHelper.getObjectType(exceptions[i]));
methodDescriptor.getDeclaredThrowables().add(exception);
}
return new MethodVisitor(methodDescriptor, visitorHelper);
}