本文整理汇总了Java中org.objectweb.asm.Opcodes.ACC_TRANSIENT属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.ACC_TRANSIENT属性的具体用法?Java Opcodes.ACC_TRANSIENT怎么用?Java Opcodes.ACC_TRANSIENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.ACC_TRANSIENT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getScore
@Override
public double getScore(FieldInstance fieldA, FieldInstance fieldB, ClassEnvironment env) {
if (!checkAsmNodes(fieldA, fieldB)) return compareAsmNodes(fieldA, fieldB);
int mask = (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE) | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT | Opcodes.ACC_SYNTHETIC;
int resultA = fieldA.getAsmNode().access & mask;
int resultB = fieldB.getAsmNode().access & mask;
return 1 - Integer.bitCount(resultA ^ resultB) / 6.;
}
示例2: visitField
@Override
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
if (computeSVUID) {
if ("serialVersionUID".equals(name)) {
// since the class already has SVUID, we won't be computing it.
computeSVUID = false;
hasSVUID = true;
}
/*
* Remember field for SVUID computation For field modifiers, only
* the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
* ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT flags are used when
* computing serialVersionUID values.
*/
if ((access & Opcodes.ACC_PRIVATE) == 0
|| (access & (Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT)) == 0) {
int mods = access
& (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
| Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
| Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
svuidFields.add(new Item(name, mods, desc));
}
}
return super.visitField(access, name, desc, signature, value);
}
示例3: 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 ");
}
}
示例4: appendAccess
/**
* Appends a string representation of the given access modifiers to
* {@link #buf buf}.
*
* @param access
* some access modifiers.
*/
private void appendAccess(final int access) {
if ((access & Opcodes.ACC_PUBLIC) != 0) {
buf.append("public ");
}
if ((access & Opcodes.ACC_PRIVATE) != 0) {
buf.append("private ");
}
if ((access & Opcodes.ACC_PROTECTED) != 0) {
buf.append("protected ");
}
if ((access & Opcodes.ACC_FINAL) != 0) {
buf.append("final ");
}
if ((access & Opcodes.ACC_STATIC) != 0) {
buf.append("static ");
}
if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
buf.append("synchronized ");
}
if ((access & Opcodes.ACC_VOLATILE) != 0) {
buf.append("volatile ");
}
if ((access & Opcodes.ACC_TRANSIENT) != 0) {
buf.append("transient ");
}
if ((access & Opcodes.ACC_ABSTRACT) != 0) {
buf.append("abstract ");
}
if ((access & Opcodes.ACC_STRICT) != 0) {
buf.append("strictfp ");
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
buf.append("synthetic ");
}
if ((access & Opcodes.ACC_MANDATED) != 0) {
buf.append("mandated ");
}
if ((access & Opcodes.ACC_ENUM) != 0) {
buf.append("enum ");
}
}