FieldSourcerpublic class FieldSourcer extends Object implements org.objectweb.asm.FieldVisitorA field visitor that generates Java source defining a field. |
Fields Summary |
---|
private final Output | mOutput | private final int | mAccess | private final String | mName | private final String | mDesc | private final String | mSignature |
Constructors Summary |
---|
public FieldSourcer(Output output, int access, String name, String desc, String signature)
mOutput = output;
mAccess = access;
mName = name;
mDesc = desc;
mSignature = signature;
|
Methods Summary |
---|
public org.objectweb.asm.AnnotationVisitor | visitAnnotation(java.lang.String desc, boolean visible)
mOutput.write("@%s", desc);
return new AnnotationSourcer(mOutput);
| public void | visitAttribute(org.objectweb.asm.Attribute attr)
mOutput.write("%s /* non-standard attribute */ ", attr.type);
| public void | visitEnd()
// Need to write type and field name after the annotations and attributes.
AccessSourcer as = new AccessSourcer(mOutput);
as.write(mAccess, AccessSourcer.IS_FIELD);
if (mSignature == null) {
mOutput.write(" %s", Type.getType(mDesc).getClassName());
} else {
mOutput.write(" ");
SignatureReader sigReader = new SignatureReader(mSignature);
SignatureSourcer sigSourcer = new SignatureSourcer();
sigReader.acceptType(sigSourcer);
mOutput.write(sigSourcer.toString());
}
mOutput.write(" %s", mName);
mOutput.write(";\n");
|
|