private Opcode getInvokeOp(int classAccessFlags, int methodAccessFlags, boolean isRange) { Opcode invokeOp; boolean isInterface = Modifier.isInterface(classAccessFlags); if (isInterface) { invokeOp = isRange ? Opcode.INVOKE_INTERFACE_RANGE : Opcode.INVOKE_INTERFACE; return invokeOp; } boolean isStatic = Modifier.isStatic(methodAccessFlags); boolean isPrivate = Modifier.isPrivate(methodAccessFlags); boolean isConstructor = (methodAccessFlags & AccessFlags.CONSTRUCTOR.getValue()) != 0; if (isStatic) { invokeOp = isRange ? Opcode.INVOKE_STATIC_RANGE : Opcode.INVOKE_STATIC; } else if (isPrivate || isConstructor) { invokeOp = isRange ? Opcode.INVOKE_DIRECT_RANGE : Opcode.INVOKE_DIRECT; } else { invokeOp = isRange ? Opcode.INVOKE_VIRTUAL_RANGE : Opcode.INVOKE_VIRTUAL; } return invokeOp; }
/** * Returns true if this class is an interface. * * If this class is not defined, then this will throw an UnresolvedClassException * * @return True if this class is an interface */ public boolean isInterface() { ClassDef classDef = getClassDef(); return (classDef.getAccessFlags() & AccessFlags.INTERFACE.getValue()) != 0; }
value |= AccessFlags.getAccessFlag(ACCESS_SPEC15.getText()).getValue();
@Override public boolean isSynthetic() { return (modifiers & SYNTHETIC.getValue()) != 0; }
@Override public boolean isAbstract() { return (modifiers & ABSTRACT.getValue()) != 0; }
@Override public boolean isFinal() { return (eMethod.getAccessFlags() & FINAL.getValue()) != 0; }
@Override public boolean isStatic() { return (eMethod.getAccessFlags() & STATIC.getValue()) != 0; }
@Override public boolean isPrivate() { return (eMethod.getAccessFlags() & PRIVATE.getValue()) != 0; }
@Override public boolean isSynchronized() { return (eMethod.getAccessFlags() & DECLARED_SYNCHRONIZED.getValue()) != 0; }
@Override public boolean isFinal() { return (eField.getAccessFlags() & FINAL.getValue()) != 0; }
@Override public boolean isStatic() { return (eField.getAccessFlags() & STATIC.getValue()) != 0; }
@Override public boolean isNative() { return (eMethod.getAccessFlags() & NATIVE.getValue()) != 0; }
@Override public boolean isProtected() { return (eMethod.getAccessFlags() & PROTECTED.getValue()) != 0; }
/** * Returns true if this class is an interface. * * If this class is not defined, then this will throw an UnresolvedClassException * * @return True if this class is an interface */ public boolean isInterface() { ClassDef classDef = getClassDef(); return (classDef.getAccessFlags() & AccessFlags.INTERFACE.getValue()) != 0; }
/** * Returns true if this class is an interface. * * If this class is not defined, then this will throw an UnresolvedClassException * * @return True if this class is an interface */ public boolean isInterface() { ClassDef classDef = getClassDef(); return (classDef.getAccessFlags() & AccessFlags.INTERFACE.getValue()) != 0; }
public static ClassDef makeInterfaceDef(@Nonnull String classType, String... interfaces) { return new ImmutableClassDef(classType, AccessFlags.INTERFACE.getValue(), "Ljava/lang/Object;", ImmutableSet.copyOf(interfaces), null, null, null, null, null, null); } }