本文整理汇总了Java中org.objectweb.asm.Opcodes.ACC_DEPRECATED属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.ACC_DEPRECATED属性的具体用法?Java Opcodes.ACC_DEPRECATED怎么用?Java Opcodes.ACC_DEPRECATED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.ACC_DEPRECATED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
@Override
public void visit(final int version, final int access, final String name,
final String signature, final String superName,
final String[] interfaces) {
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cp.newUTF8("Deprecated");
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
cp.newUTF8("Synthetic");
}
cp.newClass(name);
if (signature != null) {
cp.newUTF8("Signature");
cp.newUTF8(signature);
}
if (superName != null) {
cp.newClass(superName);
}
if (interfaces != null) {
for (int i = 0; i < interfaces.length; ++i) {
cp.newClass(interfaces[i]);
}
}
cv.visit(version, access, name, signature, superName, interfaces);
}
示例2: visitField
@Override
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
cp.newUTF8("Synthetic");
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cp.newUTF8("Deprecated");
}
cp.newUTF8(name);
cp.newUTF8(desc);
if (signature != null) {
cp.newUTF8("Signature");
cp.newUTF8(signature);
}
if (value != null) {
cp.newConst(value);
}
return new FieldConstantsCollector(cv.visitField(access, name, desc,
signature, value), cp);
}
示例3: visitMethod
@Override
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
cp.newUTF8("Synthetic");
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cp.newUTF8("Deprecated");
}
cp.newUTF8(name);
cp.newUTF8(desc);
if (signature != null) {
cp.newUTF8("Signature");
cp.newUTF8(signature);
}
if (exceptions != null) {
cp.newUTF8("Exceptions");
for (int i = 0; i < exceptions.length; ++i) {
cp.newClass(exceptions[i]);
}
}
return new MethodConstantsCollector(cv.visitMethod(access, name, desc,
signature, exceptions), cp);
}
示例4: appendAccess
static void appendAccess(final int access, final StringBuilder sb) {
if ((access & Opcodes.ACC_PUBLIC) != 0) {
sb.append("public ");
}
if ((access & Opcodes.ACC_PRIVATE) != 0) {
sb.append("private ");
}
if ((access & Opcodes.ACC_PROTECTED) != 0) {
sb.append("protected ");
}
if ((access & Opcodes.ACC_FINAL) != 0) {
sb.append("final ");
}
if ((access & Opcodes.ACC_STATIC) != 0) {
sb.append("static ");
}
if ((access & Opcodes.ACC_SUPER) != 0) {
if ((access & ACCESS_CLASS) == 0) {
sb.append("synchronized ");
} else {
sb.append("super ");
}
}
if ((access & Opcodes.ACC_VOLATILE) != 0) {
if ((access & ACCESS_FIELD) == 0) {
sb.append("bridge ");
} else {
sb.append("volatile ");
}
}
if ((access & Opcodes.ACC_TRANSIENT) != 0) {
if ((access & ACCESS_FIELD) == 0) {
sb.append("varargs ");
} else {
sb.append("transient ");
}
}
if ((access & Opcodes.ACC_NATIVE) != 0) {
sb.append("native ");
}
if ((access & Opcodes.ACC_STRICT) != 0) {
sb.append("strict ");
}
if ((access & Opcodes.ACC_INTERFACE) != 0) {
sb.append("interface ");
}
if ((access & Opcodes.ACC_ABSTRACT) != 0) {
sb.append("abstract ");
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
sb.append("synthetic ");
}
if ((access & Opcodes.ACC_ANNOTATION) != 0) {
sb.append("annotation ");
}
if ((access & Opcodes.ACC_ENUM) != 0) {
sb.append("enum ");
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
sb.append("deprecated ");
}
if ((access & Opcodes.ACC_MANDATED) != 0) {
sb.append("mandated ");
}
}
示例5: visit
@Override
public void visit(final int version, final int access, final String name,
final String signature, final String superName,
final String[] interfaces) {
this.access = access;
int major = version & 0xFFFF;
int minor = version >>> 16;
buf.setLength(0);
buf.append("// class version ").append(major).append('.').append(minor)
.append(" (").append(version).append(")\n");
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
buf.append("// DEPRECATED\n");
}
buf.append("// access flags 0x")
.append(Integer.toHexString(access).toUpperCase()).append('\n');
appendDescriptor(CLASS_SIGNATURE, signature);
if (signature != null) {
TraceSignatureVisitor sv = new TraceSignatureVisitor(access);
SignatureReader r = new SignatureReader(signature);
r.accept(sv);
buf.append("// declaration: ").append(name)
.append(sv.getDeclaration()).append('\n');
}
appendAccess(access & ~Opcodes.ACC_SUPER);
if ((access & Opcodes.ACC_ANNOTATION) != 0) {
buf.append("@interface ");
} else if ((access & Opcodes.ACC_INTERFACE) != 0) {
buf.append("interface ");
} else if ((access & Opcodes.ACC_ENUM) == 0) {
buf.append("class ");
}
appendDescriptor(INTERNAL_NAME, name);
if (superName != null && !"java/lang/Object".equals(superName)) {
buf.append(" extends ");
appendDescriptor(INTERNAL_NAME, superName);
buf.append(' ');
}
if (interfaces != null && interfaces.length > 0) {
buf.append(" implements ");
for (int i = 0; i < interfaces.length; ++i) {
appendDescriptor(INTERNAL_NAME, interfaces[i]);
buf.append(' ');
}
}
buf.append(" {\n\n");
text.add(buf.toString());
}
示例6: visitField
@Override
public Textifier 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 0x")
.append(Integer.toHexString(access).toUpperCase()).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());
Textifier t = createTextifier();
text.add(t.getText());
return t;
}
示例7: visitMethod
@Override
public Textifier visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
buf.setLength(0);
buf.append('\n');
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
buf.append(tab).append("// DEPRECATED\n");
}
buf.append(tab).append("// access flags 0x")
.append(Integer.toHexString(access).toUpperCase()).append('\n');
if (signature != null) {
buf.append(tab);
appendDescriptor(METHOD_SIGNATURE, signature);
TraceSignatureVisitor v = new TraceSignatureVisitor(0);
SignatureReader r = new SignatureReader(signature);
r.accept(v);
String genericDecl = v.getDeclaration();
String genericReturn = v.getReturnType();
String genericExceptions = v.getExceptions();
buf.append(tab).append("// declaration: ").append(genericReturn)
.append(' ').append(name).append(genericDecl);
if (genericExceptions != null) {
buf.append(" throws ").append(genericExceptions);
}
buf.append('\n');
}
buf.append(tab);
appendAccess(access & ~Opcodes.ACC_VOLATILE);
if ((access & Opcodes.ACC_NATIVE) != 0) {
buf.append("native ");
}
if ((access & Opcodes.ACC_VARARGS) != 0) {
buf.append("varargs ");
}
if ((access & Opcodes.ACC_BRIDGE) != 0) {
buf.append("bridge ");
}
if ((this.access & Opcodes.ACC_INTERFACE) != 0
&& (access & Opcodes.ACC_ABSTRACT) == 0
&& (access & Opcodes.ACC_STATIC) == 0) {
buf.append("default ");
}
buf.append(name);
appendDescriptor(METHOD_DESCRIPTOR, desc);
if (exceptions != null && exceptions.length > 0) {
buf.append(" throws ");
for (int i = 0; i < exceptions.length; ++i) {
appendDescriptor(INTERNAL_NAME, exceptions[i]);
buf.append(' ');
}
}
buf.append('\n');
text.add(buf.toString());
Textifier t = createTextifier();
text.add(t.getText());
return t;
}