Search in sources :

Example 66 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visit_same_locals_1_stack_item_frame.

@Override
public Element visit_same_locals_1_stack_item_frame(same_locals_1_stack_item_frame s, Void p) {
    Element e = new Element("SameLocals1StackItemFrame");
    e.setAttr("tag", "" + s.frame_type);
    e.addAll(getVerificationTypeInfo("Stack", s.stack));
    e.trimToSize();
    return e;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 67 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitFieldref.

@Override
public String visitFieldref(CONSTANT_Fieldref_info c, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        try {
            value = visit(cfpool.get(c.class_index), c.class_index);
            value = value.concat(" " + visit(cfpool.get(c.name_and_type_index), c.name_and_type_index));
            slist.set(p, value);
            xpool.add(new Element("CONSTANT_Fieldref", new String[] { "id", p.toString() }, value));
        } catch (ConstantPoolException ex) {
            ex.printStackTrace();
        }
    }
    return value;
}
Also used : Element(xmlkit.XMLKit.Element) ConstantPoolException(com.sun.tools.classfile.ConstantPoolException)

Example 68 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitSourceFile.

@Override
public Element visitSourceFile(SourceFile_attribute sf, Element p) {
    String aname = x.getCpString(sf.attribute_name_index);
    String sname = x.getCpString(sf.sourcefile_index);
    Element se = new Element(aname);
    se.add(sname);
    se.trimToSize();
    p.add(se);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 69 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitNameAndType.

@Override
public String visitNameAndType(CONSTANT_NameAndType_info c, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        try {
            value = visit(cfpool.get(c.name_index), c.name_index);
            value = value.concat(" " + visit(cfpool.get(c.type_index), c.type_index));
            slist.set(p, value);
            xpool.add(new Element("CONSTANT_NameAndType", new String[] { "id", p.toString() }, value));
        } catch (InvalidIndex ex) {
            ex.printStackTrace();
        }
    }
    return value;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 70 with Element

use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.

the class AnnotationsElementVisitor method visitLocalVariableTypeTable.

@Override
public Element visitLocalVariableTypeTable(LocalVariableTypeTable_attribute lvtt, Element p) {
    String name = x.getCpString(lvtt.attribute_name_index);
    for (LocalVariableTypeTable_attribute.Entry e : lvtt.local_variable_table) {
        Element l = new Element(name);
        l.setAttr("bci", "" + e.start_pc);
        l.setAttr("span", "" + e.length);
        l.setAttr("name", x.getCpString(e.name_index));
        l.setAttr("type", x.getCpString(e.signature_index));
        l.setAttr("slot", "" + e.index);
        l.trimToSize();
        p.add(l);
    }
    // already added to parent
    return null;
}
Also used : Element(xmlkit.XMLKit.Element) LocalVariableTypeTable_attribute(com.sun.tools.classfile.LocalVariableTypeTable_attribute)

Aggregations

Element (xmlkit.XMLKit.Element)77 ConstantPoolException (com.sun.tools.classfile.ConstantPoolException)8 TypeAnnotation (com.sun.tools.classfile.TypeAnnotation)7 Annotation (com.sun.tools.classfile.Annotation)5 StackMapTable_attribute (com.sun.tools.classfile.StackMapTable_attribute)2 AccessFlags (com.sun.tools.classfile.AccessFlags)1 Attribute (com.sun.tools.classfile.Attribute)1 BootstrapMethods_attribute (com.sun.tools.classfile.BootstrapMethods_attribute)1 CharacterRangeTable_attribute (com.sun.tools.classfile.CharacterRangeTable_attribute)1 ClassFile (com.sun.tools.classfile.ClassFile)1 Code_attribute (com.sun.tools.classfile.Code_attribute)1 DefaultAttribute (com.sun.tools.classfile.DefaultAttribute)1 Field (com.sun.tools.classfile.Field)1 Info (com.sun.tools.classfile.InnerClasses_attribute.Info)1 Instruction (com.sun.tools.classfile.Instruction)1 LineNumberTable_attribute (com.sun.tools.classfile.LineNumberTable_attribute)1 LocalVariableTable_attribute (com.sun.tools.classfile.LocalVariableTable_attribute)1 LocalVariableTypeTable_attribute (com.sun.tools.classfile.LocalVariableTypeTable_attribute)1 Method (com.sun.tools.classfile.Method)1 MethodParameters_attribute (com.sun.tools.classfile.MethodParameters_attribute)1