1 package org.ibex.classgen;
5 public class FieldGen implements CGConst {
6 private final CPGen cp;
7 private final String name;
8 private final Type type;
9 private final int flags;
10 private final ClassGen.AttrGen attrs;
12 FieldGen(ClassGen owner, String name,Type type, int flags) {
13 if((flags & ~(ACC_PUBLIC|ACC_PRIVATE|ACC_PROTECTED|ACC_VOLATILE|ACC_TRANSIENT|ACC_STATIC|ACC_FINAL)) != 0)
14 throw new IllegalArgumentException("invalid flags");
19 this.attrs = new ClassGen.AttrGen(cp);
22 cp.addUtf8(type.getDescriptor());
25 public void dump(DataOutput o) throws IOException {
27 o.writeShort(cp.getUtf8Index(name));
28 o.writeShort(cp.getUtf8Index(type.getDescriptor()));
29 o.writeShort(attrs.size());