Package javassist.bytecode
Class ClassFileWriter.FieldWriter
java.lang.Object
javassist.bytecode.ClassFileWriter.FieldWriter
- Enclosing class:
ClassFileWriter
Field.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassFileWriter.ConstPoolWriter
private int
protected ByteStream
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int accessFlags, int name, int descriptor, ClassFileWriter.AttributeWriter aw) Adds a new field.void
add
(int accessFlags, String name, String descriptor, ClassFileWriter.AttributeWriter aw) Adds a new field.(package private) int
dataSize()
(package private) int
size()
(package private) void
write
(OutputStream out) Writes the added fields.
-
Field Details
-
output
-
constPool
-
fieldCount
private int fieldCount
-
-
Constructor Details
-
FieldWriter
FieldWriter(ClassFileWriter.ConstPoolWriter cp)
-
-
Method Details
-
add
public void add(int accessFlags, String name, String descriptor, ClassFileWriter.AttributeWriter aw) Adds a new field.- Parameters:
accessFlags
- access flags.name
- the field name.descriptor
- the field type.aw
- the attributes of the field. may be null.- See Also:
-
add
Adds a new field.- Parameters:
accessFlags
- access flags.name
- the field name. an index indicating itsCONSTANT_Utf8_info
.descriptor
- the field type. an index indicating itsCONSTANT_Utf8_info
.aw
- the attributes of the field. may be null.- See Also:
-
size
int size() -
dataSize
int dataSize() -
write
Writes the added fields.- Throws:
IOException
-