package com.gmail.woodyc40.commons.reflection.asm;

import com.gmail.woodyc40.commons.reflection.asm.sun.ClassFileAssembler;

public class BytecodeField {
    private final int    access;
    private final String name;
    private final String desc;

    public BytecodeField(String name, int access, Class<?> type) {
        this.access = access;
        this.name = name;
        this.desc = Descriptors.descField(type);
    }

    public void add(ClassBytecode bytecode) {
        ClassFileAssembler assembler = bytecode.getAssembler();
        Pool pool = bytecode.getConstantPool();

        assembler.emitShort((short) access); // Access
        assembler.emitShort((short) pool.newUTF(name)); // Name
        assembler.emitShort((short) pool.newUTF(desc)); // Descriptor
        assembler.emitShort((short) 0); // Attributes // TODO attributes for code ? fields = value
    }
}

@@ -156,99 +156,873 @@
     
-private final int    access;%0A    private final String name;%0A    private final String desc;%0A
+/**%0A     * The access modifiers of the field, specified by %7B@link com.gmail.woodyc40.commons.reflection.asm.Modifiers%7D%0A     */ %0A    private final int    access;%0A    /**%0A     * The declared title of the field%0A     */ %0A    private final String name;%0A    /**%0A     * The descriptor of the field, for internal use only. Can be used to decode %3Ccode%3Eclass%3C/code%3E type of %0A     * the field%0A     */ %0A    private final String desc;%0A%0A    /**%0A     * Creates a new instnance of a field specifier.%0A     * %0A     * @param name the name of the field to be declared by the bytecode dump%0A     * @param access the access modifiers of the field, specified by %0A     *        %7B@link com.gmail.woodyc40.commons.reflection.asm.Modifiers%7D%0A     * @param type the type of field to be assigned a value, for example:%0A     *        %3Ccode%3Ebyte vec;%3C/code%3E would be %3Ccode%3Ebyte.class%3C/code%3E%0A     */ 
 %0A   
@@ -1197,16 +1197,174 @@
 %0A    %7D%0A%0A
+    /**%0A     * Adds the field to the bytecode dump of a represented builder%0A     * %0A     * @param bytecode the builder to add the field bytecode to %0A     */ %0A
     publ

Update BytecodeField.java