public JAttribute newInstance(JClass clazz, Object owner, DataInputStream stream) throws IOException { String name = clazz.getConstantPool().lookupUtf8(stream.readShort()); Integer size = new Integer(stream.readInt()); Constructor constr = (Constructor) constructors.get(name); if (constr == null) constr = defaultConstructor; Object[] args = new Object[] {context, clazz, owner, name, size, stream}; try { return (JAttribute) constr.newInstance(args); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } }
public JAttribute(FJBGContext context, JClass clazz, String name) { this.nameIdx = clazz.getConstantPool().addUtf8(name); }
public JAttribute(FJBGContext context, JClass clazz) { this.nameIdx = clazz.getConstantPool().addUtf8(getName()); }