本文整理汇总了Java中org.objectweb.asm.Opcodes.ACC_ABSTRACT属性的典型用法代码示例。如果您正苦于以下问题:Java Opcodes.ACC_ABSTRACT属性的具体用法?Java Opcodes.ACC_ABSTRACT怎么用?Java Opcodes.ACC_ABSTRACT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.objectweb.asm.Opcodes
的用法示例。
在下文中一共展示了Opcodes.ACC_ABSTRACT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAccess
public int getAccess() {
if (asmNodes != null) {
return asmNodes[0].access;
} else {
int ret = Opcodes.ACC_PUBLIC;
if (!implementers.isEmpty()) {
ret |= Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
} else if (superClass != null && superClass.id.equals("Ljava/lang/Enum;")) {
ret |= Opcodes.ACC_ENUM;
if (childClasses.isEmpty()) ret |= Opcodes.ACC_FINAL;
} else if (interfaces.size() == 1 && interfaces.iterator().next().id.equals("Ljava/lang/annotation/Annotation;")) {
ret |= Opcodes.ACC_ANNOTATION | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
}
return ret;
}
}
示例2: visitCode
@Override
public void visitCode() {
if ((access & Opcodes.ACC_ABSTRACT) != 0) {
throw new RuntimeException("Abstract methods cannot have code");
}
startCode = true;
super.visitCode();
}
示例3: instrument
private boolean instrument(String name, String signature, int access) {
return
(access & Opcodes.ACC_ABSTRACT) == 0 &&
(access & Opcodes.ACC_BRIDGE) == 0 &&
(access & Opcodes.ACC_NATIVE) == 0 &&
(isEntryPoint(name, signature) || isExitPoint(name, signature));
}
示例4: canMixinMethod
private static boolean canMixinMethod(ClassNode node, MethodNode method)
{
if (hasMethod(node, method.name))
return false;
if ((method.access & Opcodes.ACC_ABSTRACT) != 0)
return false;
if ((method.access & Opcodes.ACC_STATIC) != 0)
return false;
if (method.name.equals("<init>"))
return false;
if (method.name.equals("<clinit>"))
return false;
return true;
}
示例5: visitMethod
@Override
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
if (computeSVUID) {
if ("<clinit>".equals(name)) {
hasStaticInitializer = true;
}
/*
* Remembers non private constructors and methods for SVUID
* computation For constructor and method modifiers, only the
* ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
* ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags
* are used.
*/
int mods = access
& (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
| Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
| Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
| Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_STRICT);
// all non private methods
if ((access & Opcodes.ACC_PRIVATE) == 0) {
if ("<init>".equals(name)) {
svuidConstructors.add(new Item(name, mods, desc));
} else if (!"<clinit>".equals(name)) {
svuidMethods.add(new Item(name, mods, desc));
}
}
}
return super.visitMethod(access, name, desc, signature, exceptions);
}
示例6: visitCode
@Override
public final void visitCode() {
if ((access & (Opcodes.ACC_ABSTRACT | Opcodes.ACC_INTERFACE | Opcodes.ACC_NATIVE)) == 0) {
sa.addStart("code", new AttributesImpl());
}
}
示例7: instrument
private boolean instrument(int access) {
return
(access & Opcodes.ACC_ABSTRACT) == 0 &&
(access & Opcodes.ACC_BRIDGE) == 0 &&
(access & Opcodes.ACC_NATIVE) == 0;
}
示例8: instrument
private boolean instrument(int access) {
return (access & Opcodes.ACC_ABSTRACT) == 0 && (access & Opcodes.ACC_BRIDGE) == 0 && (access & Opcodes.ACC_NATIVE) == 0;
}
示例9: standardMethod
private static boolean standardMethod(int access, boolean isStatic) {
return (access & Opcodes.ACC_NATIVE) == 0 && (access & Opcodes.ACC_ABSTRACT) == 0 && (access & Opcodes.ACC_STATIC)==(isStatic?Opcodes.ACC_STATIC:0);
}
示例10: MethodNode
/**
* Constructs a new {@link MethodNode}.
*
* @param api
* the ASM API version implemented by this visitor. Must be one
* of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
* @param access
* the method's access flags (see {@link Opcodes}). This
* parameter also indicates if the method is synthetic and/or
* deprecated.
* @param name
* the method's name.
* @param desc
* the method's descriptor (see {@link Type}).
* @param signature
* the method's signature. May be <tt>null</tt>.
* @param exceptions
* the internal names of the method's exception classes (see
* {@link Type#getInternalName() getInternalName}). May be
* <tt>null</tt>.
*/
public MethodNode(final int api, final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
super(api);
this.access = access;
this.name = name;
this.desc = desc;
this.signature = signature;
this.exceptions = new ArrayList<String>(exceptions == null ? 0
: exceptions.length);
boolean isAbstract = (access & Opcodes.ACC_ABSTRACT) != 0;
if (!isAbstract) {
this.localVariables = new ArrayList<LocalVariableNode>(5);
}
this.tryCatchBlocks = new ArrayList<TryCatchBlockNode>();
if (exceptions != null) {
this.exceptions.addAll(Arrays.asList(exceptions));
}
this.instructions = new InsnList();
}
示例11: 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 ");
}
}
示例12: 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;
}
示例13: visitMethod
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
if (check && (access & (Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT))==0)
return new Maxs(access, this.name, name, desc, super.visitMethod(access, name, desc, signature, exceptions), methodToLargestLocal);
else
return super.visitMethod(access, name, desc, signature, exceptions);
}
示例14: isAbstract
public static ClassAccessMatcher isAbstract() {
return new ClassAccessMatcher(Opcodes.ACC_ABSTRACT);
}