org.mockito.asm.MethodVisitor的实例源码

项目:mockito-cglib    文件FrameNode.java   
/**
 * Makes the given visitor visit this stack map frame.
 * 
 * @param mv a method visitor.
 */
public void accept(final MethodVisitor mv) {
    switch (type) {
        case Opcodes.F_NEW:
        case Opcodes.F_FULL:
            mv.visitFrame(type,local.size(),asArray(local),stack.size(),asArray(stack));
            break;
        case Opcodes.F_APPEND:
            mv.visitFrame(type,null);
            break;
        case Opcodes.F_CHOP:
            mv.visitFrame(type,null);
            break;
        case Opcodes.F_SAME:
            mv.visitFrame(type,null,null);
            break;
        case Opcodes.F_SAME1:
            mv.visitFrame(type,1,asArray(stack));
            break;
    }
}
项目:nedis    文件TestNedisClientImpl.java   
@Override
public MethodVisitor visitMethod(int access,String name,String desc,String signature,String[] exceptions) {
    if ((Opcodes.ACC_PUBLIC & access) == 0 || EXCLUDE_METHODS.contains(name)
            || name.contains("<")) {
        return null;
    }
    if (name.endsWith("0")) {
        name = name.substring(0,name.length() - 1);
    }
    int index = -1;
    for (int i = 0; i < name.length(); i++) {
        if (Character.isUpperCase(name.charat(i))) {
            index = i;
            break;
        }
    }
    if (index < 0) {
        return new FindEnumVisitor(name,name.toupperCase(),null);
    } else {
        String cmd = name.substring(0,index).toupperCase();
        return new FindEnumVisitor(name,cmd,name.substring(index).toupperCase());
    }
}
项目:astor    文件FrameNode.java   
/**
 * Makes the given visitor visit this stack map frame.
 * 
 * @param mv a method visitor.
 */
public void accept(final MethodVisitor mv) {
    switch (type) {
        case Opcodes.F_NEW:
        case Opcodes.F_FULL:
            mv.visitFrame(type,asArray(stack));
            break;
    }
}
项目:mockito-cglib    文件LocalVariablesSorter.java   
public LocalVariablesSorter(
    final int access,final String desc,final MethodVisitor mv)
{
    super(mv);
    state = new State();
    Type[] args = Type.getArgumentTypes(desc);
    state.nextLocal = ((Opcodes.ACC_STATIC & access) != 0) ? 0 : 1;
    for (int i = 0; i < args.length; i++) {
        state.nextLocal += args[i].getSize();
    }
    firstLocal = state.nextLocal;
}
项目:mockito-cglib    文件ClassNode.java   
public MethodVisitor visitMethod(
    final int access,final String name,final String signature,final String[] exceptions)
{
    MethodNode mn = new MethodNode(access,name,desc,signature,exceptions);
    methods.add(mn);
    return mn;
}
项目:mockito-cglib    文件LocalVariableNode.java   
/**
 * Makes the given visitor visit this local variable declaration.
 * 
 * @param mv a method visitor.
 */
public void accept(final MethodVisitor mv) {
    mv.visitLocalVariable(name,start.getLabel(),end.getLabel(),index);
}
项目:mockito-cglib    文件InsnList.java   
/**
 * Makes the given visitor visit all of the instructions in this list.
 * 
 * @param mv the method visitor that must visit the instructions.
 */
public void accept(final MethodVisitor mv) {
    AbstractInsnNode insn = first;
    while (insn != null) {
        insn.accept(mv);
        insn = insn.next;
    }
}
项目:mockito-cglib    文件LookupSwitchInsnNode.java   
public void accept(final MethodVisitor mv) {
    int[] keys = new int[this.keys.size()];
    for (int i = 0; i < keys.length; ++i) {
        keys[i] = ((Integer) this.keys.get(i)).intValue();
    }
    Label[] labels = new Label[this.labels.size()];
    for (int i = 0; i < labels.length; ++i) {
        labels[i] = ((LabelNode) this.labels.get(i)).getLabel();
    }
    mv.visitLookupSwitchInsn(dflt.getLabel(),keys,labels);
}
项目:mockito-cglib    文件MethodNode.java   
/**
 * Makes the given class visitor visit this method.
 * 
 * @param cv a class visitor.
 */
public void accept(final ClassVisitor cv) {
    String[] exceptions = new String[this.exceptions.size()];
    this.exceptions.toArray(exceptions);
    MethodVisitor mv = cv.visitMethod(access,exceptions);
    if (mv != null) {
        accept(mv);
    }
}
项目:mockito-cglib    文件TableSwitchInsnNode.java   
public void accept(final MethodVisitor mv) {
    Label[] labels = new Label[this.labels.size()];
    for (int i = 0; i < labels.length; ++i) {
        labels[i] = ((LabelNode) this.labels.get(i)).getLabel();
    }
    mv.visitTableSwitchInsn(min,max,dflt.getLabel(),labels);
}
项目:mockito-cglib    文件CheckClassAdapter.java   
public MethodVisitor visitMethod(
    final int access,final String[] exceptions)
{
    checkState();
    checkAccess(access,Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
            + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
            + Opcodes.ACC_FINAL + Opcodes.ACC_SYNCHRONIZED
            + Opcodes.ACC_BRIDGE + Opcodes.ACC_VaraRGS + Opcodes.ACC_NATIVE
            + Opcodes.ACC_ABSTRACT + Opcodes.ACC_STRICT
            + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_DEPRECATED);
    CheckMethodAdapter.checkMethodIdentifier(name,"method name");
    CheckMethodAdapter.checkMethodDesc(desc);
    if (signature != null) {
        CheckMethodAdapter.checkMethodSignature(signature);
    }
    if (exceptions != null) {
        for (int i = 0; i < exceptions.length; ++i) {
            CheckMethodAdapter.checkInternalName(exceptions[i],"exception name at index " + i);
        }
    }
    return new CheckMethodAdapter(cv.visitMethod(access,exceptions));
}
项目:mockito-cglib    文件ASMifierClassVisitor.java   
public MethodVisitor visitMethod(
    final int access,final String[] exceptions)
{
    buf.setLength(0);
    buf.append("{\n");
    buf.append("mv = cw.visitMethod(");
    appendAccess(access);
    buf.append(",");
    appendConstant(name);
    buf.append(",");
    appendConstant(desc);
    buf.append(",");
    appendConstant(signature);
    buf.append(",");
    if (exceptions != null && exceptions.length > 0) {
        buf.append("new String[] {");
        for (int i = 0; i < exceptions.length; ++i) {
            buf.append(i == 0 ? " " : ",");
            appendConstant(exceptions[i]);
        }
        buf.append(" }");
    } else {
        buf.append("null");
    }
    buf.append(");\n");
    text.add(buf.toString());
    ASMifierMethodVisitor acv = createASMifierMethodVisitor();
    text.add(acv.getText());
    text.add("}\n");
    return acv;
}
项目:astor    文件LocalVariablesSorter.java   
public LocalVariablesSorter(
    final int access,final MethodVisitor mv)
{
    super(mv);
    state = new State();
    Type[] args = Type.getArgumentTypes(desc);
    state.nextLocal = ((Opcodes.ACC_STATIC & access) != 0) ? 0 : 1;
    for (int i = 0; i < args.length; i++) {
        state.nextLocal += args[i].getSize();
    }
    firstLocal = state.nextLocal;
}
项目:astor    文件ClassNode.java   
public MethodVisitor visitMethod(
    final int access,exceptions);
    methods.add(mn);
    return mn;
}
项目:astor    文件LocalVariableNode.java   
/**
 * Makes the given visitor visit this local variable declaration.
 * 
 * @param mv a method visitor.
 */
public void accept(final MethodVisitor mv) {
    mv.visitLocalVariable(name,index);
}
项目:astor    文件InsnList.java   
/**
 * Makes the given visitor visit all of the instructions in this list.
 * 
 * @param mv the method visitor that must visit the instructions.
 */
public void accept(final MethodVisitor mv) {
    AbstractInsnNode insn = first;
    while (insn != null) {
        insn.accept(mv);
        insn = insn.next;
    }
}
项目:astor    文件LookupSwitchInsnNode.java   
public void accept(final MethodVisitor mv) {
    int[] keys = new int[this.keys.size()];
    for (int i = 0; i < keys.length; ++i) {
        keys[i] = ((Integer) this.keys.get(i)).intValue();
    }
    Label[] labels = new Label[this.labels.size()];
    for (int i = 0; i < labels.length; ++i) {
        labels[i] = ((LabelNode) this.labels.get(i)).getLabel();
    }
    mv.visitLookupSwitchInsn(dflt.getLabel(),labels);
}
项目:astor    文件MethodNode.java   
/**
 * Makes the given class visitor visit this method.
 * 
 * @param cv a class visitor.
 */
public void accept(final ClassVisitor cv) {
    String[] exceptions = new String[this.exceptions.size()];
    this.exceptions.toArray(exceptions);
    MethodVisitor mv = cv.visitMethod(access,exceptions);
    if (mv != null) {
        accept(mv);
    }
}
项目:astor    文件TableSwitchInsnNode.java   
public void accept(final MethodVisitor mv) {
    Label[] labels = new Label[this.labels.size()];
    for (int i = 0; i < labels.length; ++i) {
        labels[i] = ((LabelNode) this.labels.get(i)).getLabel();
    }
    mv.visitTableSwitchInsn(min,labels);
}
项目:astor    文件CheckClassAdapter.java   
public MethodVisitor visitMethod(
    final int access,exceptions));
}
项目:astor    文件ASMifierClassVisitor.java   
public MethodVisitor visitMethod(
    final int access,");
            appendConstant(exceptions[i]);
        }
        buf.append(" }");
    } else {
        buf.append("null");
    }
    buf.append(");\n");
    text.add(buf.toString());
    ASMifierMethodVisitor acv = createASMifierMethodVisitor();
    text.add(acv.getText());
    text.add("}\n");
    return acv;
}
项目:mockito-cglib    文件TryCatchBlockNode.java   
/**
 * Makes the given visitor visit this try catch block.
 * 
 * @param mv a method visitor.
 */
public void accept(final MethodVisitor mv) {
    mv.visitTryCatchBlock(start.getLabel(),handler == null
            ? null
            : handler.getLabel(),type);
}
项目:mockito-cglib    文件TypeInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitTypeInsn(opcode,desc);
}
项目:mockito-cglib    文件MethodInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitMethodInsn(opcode,owner,desc);
}
项目:mockito-cglib    文件IntInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitIntInsn(opcode,operand);
}
项目:mockito-cglib    文件FieldInsnNode.java   
public void accept(final MethodVisitor cv) {
    cv.visitFieldInsn(opcode,desc);
}
项目:mockito-cglib    文件LdcInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitLdcInsn(cst);
}
项目:mockito-cglib    文件VarInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitvarInsn(opcode,var);
}
项目:mockito-cglib    文件JumpInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitJumpInsn(opcode,label.getLabel());
}
项目:mockito-cglib    文件IincInsnNode.java   
public void accept(final MethodVisitor mv) {
    mv.visitIincInsn(var,incr);
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...