本文整理汇总了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);
}
示例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;
}
示例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;
}
示例4: FieldVisitorTee
import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public FieldVisitorTee(FieldVisitor fv1, FieldVisitor fv2) {
this.fv1 = fv1;
this.fv2 = fv2;
}
示例5: CheckFieldAdapter
import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
public CheckFieldAdapter(final FieldVisitor fv) {
this.fv = fv;
}
示例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;
}
示例7: visitField
import org.mockito.asm.FieldVisitor; //导入依赖的package包/类
@Override
public FieldVisitor visitField(int access, String name, String desc, String signature,
Object value) {
return null;
}