1 30 package org.objectweb.asm.attrs; 31 32 import java.util.Map ; 33 34 import org.objectweb.asm.Attribute; 35 import org.objectweb.asm.ByteVector; 36 import org.objectweb.asm.ClassReader; 37 import org.objectweb.asm.ClassWriter; 38 import org.objectweb.asm.Label; 39 import org.objectweb.asm.util.ASMifiable; 40 import org.objectweb.asm.util.Traceable; 41 42 47 public class CodeComment extends Attribute implements ASMifiable, Traceable { 48 49 public CodeComment() { 50 super("CodeComment"); 51 } 52 53 public boolean isUnknown() { 54 return false; 55 } 56 57 public boolean isCodeAttribute() { 58 return true; 59 } 60 61 protected Attribute read( 62 final ClassReader cr, 63 final int off, 64 final int len, 65 final char[] buf, 66 final int codeOff, 67 final Label[] labels) 68 { 69 70 return new CodeComment(); 71 } 72 73 protected ByteVector write( 74 final ClassWriter cw, 75 final byte[] code, 76 final int len, 77 final int maxStack, 78 final int maxLocals) 79 { 80 return new ByteVector(); 81 } 82 83 protected Label[] getLabels() { 84 super.getLabels(); 85 return new Label[] { new Label() }; 86 } 87 88 public void asmify( 89 final StringBuffer buf, 90 final String varName, 91 final Map labelNames) 92 { 93 buf.append("Attribute ") 94 .append(varName) 95 .append(" = new org.objectweb.asm.attrs.CodeComment();"); 96 } 97 98 public void trace(final StringBuffer buf, final Map labelNames) { 99 } 100 } 101 | Popular Tags |