protected JMethod(FJBGContext context, JClass owner, int accessFlags, String name, JType returnType, JType[] argTypes, String[] argNames) { super(context, owner, accessFlags, name, new JMethodType(returnType, argTypes)); this.argNames = argNames; assert argTypes.length == argNames.length; if (isAbstract() || isNative()) { code = null; } else { code = context.JCode(owner, this); addAttribute(context.JCodeAttribute(owner, this)); if (!isStatic()) addNewLocalVariable(owner.getType(), "this"); for (int i = 0; i < argTypes.length; ++i) addNewLocalVariable(argTypes[i], argNames[i]); } }
public static List /*<JAttribute>*/ readFrom( FJBGContext context, JClass clazz, Object owner, DataInputStream stream) throws IOException { JAttributeFactory factory = context.getJAttributeFactory(); int count = stream.readShort(); ArrayList list = new ArrayList(count); for (int i = 0; i < count; ++i) list.add(factory.newInstance(clazz, owner, stream)); return list; }