FileDocCategorySizeDatePackage
ASMLocalVariableTypeTableAttribute.javaAPI DocGlassfish v2 API4447Thu Mar 02 11:51:18 GMT 2006oracle.toplink.libraries.asm.util.attrs

ASMLocalVariableTypeTableAttribute

public class ASMLocalVariableTypeTableAttribute extends LocalVariableTypeTableAttribute implements ASMifiable
An {@link ASMifiable} {@link LocalVariableTypeTableAttribute} sub class.
author
Eugene Kuleshov

Fields Summary
Constructors Summary
Methods Summary
public voidasmify(java.lang.StringBuffer buf, java.lang.String varName, java.util.Map labelNames)

    buf.append("LocalVariableTypeTableAttribute ").append(varName)
      .append(" = new LocalVariableTypeTableAttribute();\n");

    buf.append("{\n");
    buf.append("LocalVariableTypeTableAttribute ").append(varName).append("Attr");
    buf.append(" = new LocalVariableTypeTableAttribute();\n");
    if (types.size() > 0) {
      for (int i = 0; i < types.size(); i++) {
        asmify((LocalVariableType)types.get(i), buf, varName + "type" + i, labelNames);
      }
    }
    buf.append(varName).append(".visitAttribute(").append(varName);
    buf.append("Attr);\n}\n");
  
private voidasmify(oracle.toplink.libraries.asm.attrs.LocalVariableType type, java.lang.StringBuffer buf, java.lang.String varName, java.util.Map labelNames)

    declareLabel(buf, labelNames, type.start);
    declareLabel(buf, labelNames, type.end);
    buf.append("{\n");
    
    buf.append("LocalVariableType ").append(varName).append( " = new LocalVariableType();\n");
    
    buf.append(varName).append(".start = ").append( labelNames.get( type.start)).append(";\n");
    buf.append(varName).append(".end = ").append( labelNames.get( type.end)).append(";\n");
    buf.append(varName).append(".name = \"").append( type.name).append( "\";\n");
    buf.append(varName).append(".signature = ").append( type.signature).append( "\";\n");
    buf.append(varName).append(".index = ").append( type.index).append( "\";\n");
    
    buf.append( "cvAttr.types.add(").append(varName).append(");\n");
    buf.append("}\n");
  
static voiddeclareLabel(java.lang.StringBuffer buf, java.util.Map labelNames, oracle.toplink.libraries.asm.Label l)

    String name = (String)labelNames.get(l);
    if (name == null) {
      name = "l" + labelNames.size();
      labelNames.put(l, name);
      buf.append("Label ").append(name).append(" = new Label();\n");
    }
  
protected oracle.toplink.libraries.asm.Attributeread(oracle.toplink.libraries.asm.ClassReader cr, int off, int len, char[] buf, int codeOff, oracle.toplink.libraries.asm.Label[] labels)

    LocalVariableTypeTableAttribute attr = ( LocalVariableTypeTableAttribute) super.read(cr, off, len, buf, codeOff, labels);

    ASMLocalVariableTypeTableAttribute res = new ASMLocalVariableTypeTableAttribute();
    res.getTypes().addAll( attr.getTypes());
    return res;