1 30 31 package oracle.toplink.libraries.asm.util.attrs; 32 33 import java.util.Map ; 34 35 import oracle.toplink.libraries.asm.Attribute; 36 import oracle.toplink.libraries.asm.ClassReader; 37 import oracle.toplink.libraries.asm.Label; 38 import oracle.toplink.libraries.asm.attrs.EnclosingMethodAttribute; 39 40 45 46 public class ASMEnclosingMethodAttribute extends EnclosingMethodAttribute 47 implements ASMifiable 48 { 49 50 protected Attribute read (ClassReader cr, int off, 51 int len, char[] buf, int codeOff, Label[] labels) 52 { 53 EnclosingMethodAttribute attr = 54 (EnclosingMethodAttribute)super.read( 55 cr, off, len, buf, codeOff, labels); 56 57 ASMEnclosingMethodAttribute result = new ASMEnclosingMethodAttribute(); 58 result.owner = attr.owner; 59 result.name = attr.name; 60 result.desc = attr.desc; 61 return result; 62 } 63 64 public void asmify (StringBuffer buf, String varName, Map labelNames) { 65 buf.append("EnclosingMethodAttribute ").append(varName) 66 .append(" = new EnclosingMethodAttribute(\"") 67 .append(owner).append("\",\"") 68 .append(name).append("\",\"") 69 .append(desc).append("\");\n"); 70 } 71 } 72 | Popular Tags |