当前位置: 首页>>代码示例>>Java>>正文


Java FieldVisitor类代码示例

本文整理汇总了Java中org.mockito.asm.FieldVisitor的典型用法代码示例。如果您正苦于以下问题:Java FieldVisitor类的具体用法?Java FieldVisitor怎么用?Java FieldVisitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FieldVisitor类属于org.mockito.asm包,在下文中一共展示了FieldVisitor类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitField

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitor visitField(
    final int access,
    final String name,
    final String desc,
    final String signature,
    final Object value)
{
    checkState();
    checkAccess(access, Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE
            + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC
            + Opcodes.ACC_FINAL + Opcodes.ACC_VOLATILE
            + Opcodes.ACC_TRANSIENT + Opcodes.ACC_SYNTHETIC
            + Opcodes.ACC_ENUM + Opcodes.ACC_DEPRECATED);
    CheckMethodAdapter.checkIdentifier(name, "field name");
    CheckMethodAdapter.checkDesc(desc, false);
    if (signature != null) {
        CheckMethodAdapter.checkFieldSignature(signature);
    }
    if (value != null) {
        CheckMethodAdapter.checkConstant(value);
    }
    FieldVisitor av = cv.visitField(access, name, desc, signature, value);
    return new CheckFieldAdapter(av);
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:25,代码来源:CheckClassAdapter.java

示例2: visitField

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitor visitField(
    final int access,
    final String name,
    final String desc,
    final String signature,
    final Object value)
{
    buf.setLength(0);
    buf.append("{\n");
    buf.append("fv = cw.visitField(");
    appendAccess(access | ACCESS_FIELD);
    buf.append(", ");
    appendConstant(name);
    buf.append(", ");
    appendConstant(desc);
    buf.append(", ");
    appendConstant(signature);
    buf.append(", ");
    appendConstant(value);
    buf.append(");\n");
    text.add(buf.toString());
    ASMifierFieldVisitor aav = new ASMifierFieldVisitor();
    text.add(aav.getText());
    text.add("}\n");
    return aav;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:27,代码来源:ASMifierClassVisitor.java

示例3: visitField

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitor visitField(
    final int access,
    final String name,
    final String desc,
    final String signature,
    final Object value)
{
    FieldNode fn = new FieldNode(access, name, desc, signature, value);
    fields.add(fn);
    return fn;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:12,代码来源:ClassNode.java

示例4: FieldVisitorTee

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2) {
    this.fv1 = fv1;
    this.fv2 = fv2;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:5,代码来源:FieldVisitorTee.java

示例5: CheckFieldAdapter

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public CheckFieldAdapter(final FieldVisitor fv) {
    this.fv = fv;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:4,代码来源:CheckFieldAdapter.java

示例6: visitField

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitor visitField(
    final int access,
    final String name,
    final String desc,
    final String signature,
    final Object value)
{
    buf.setLength(0);
    buf.append('\n');
    if ((access & Opcodes.ACC_DEPRECATED) != 0) {
        buf.append(tab).append("// DEPRECATED\n");
    }
    buf.append(tab).append("// access flags ").append(access).append('\n');
    if (signature != null) {
        buf.append(tab);
        appendDescriptor(FIELD_SIGNATURE, signature);

        TraceSignatureVisitor sv = new TraceSignatureVisitor(0);
        SignatureReader r = new SignatureReader(signature);
        r.acceptType(sv);
        buf.append(tab)
                .append("// declaration: ")
                .append(sv.getDeclaration())
                .append('\n');
    }

    buf.append(tab);
    appendAccess(access);

    appendDescriptor(FIELD_DESCRIPTOR, desc);
    buf.append(' ').append(name);
    if (value != null) {
        buf.append(" = ");
        if (value instanceof String) {
            buf.append('\"').append(value).append('\"');
        } else {
            buf.append(value);
        }
    }

    buf.append('\n');
    text.add(buf.toString());

    TraceFieldVisitor tav = createTraceFieldVisitor();
    text.add(tav.getText());

    if (cv != null) {
        tav.fv = cv.visitField(access, name, desc, signature, value);
    }

    return tav;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:53,代码来源:TraceClassVisitor.java

示例7: visitField

import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
@Override
public FieldVisitor visitField(int access, String name, String desc, String signature,
        Object value) {
    return null;
}
 
开发者ID:CodisLabs,项目名称:nedis,代码行数:6,代码来源:TestNedisClientImpl.java


注:本文中的org.mockito.asm.FieldVisitor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。