Search in sources :

Example 16 with Element

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

the class AnnotationsElementVisitor method visitConstantPoolRefAndValue.

@Override
public Element visitConstantPoolRefAndValue(Instruction i, int i1, int i2, Void p) {
    // workaround for a potential bug in classfile
    Element ie = new Element(i.getMnemonic());
    if (i.getOpcode().equals(Opcode.IINC_W)) {
        ie.setAttr("loc", "" + i1);
        ie.setAttr("num", "" + i2);
    } else {
        ie.setAttr("ref", x.getCpString(i1));
        ie.setAttr("val", "" + i2);
    }
    return ie;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 17 with Element

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

the class AnnotationsElementVisitor method visit_same_frame_extended.

@Override
public Element visit_same_frame_extended(same_frame_extended s, Void p) {
    Element e = new Element("SameFrameExtended");
    e.setAttr("tag", "" + s.frame_type);
    e.setAttr("offset", "" + s.offset_delta);
    return e;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 18 with Element

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

the class AnnotationsElementVisitor method visitClass.

@Override
public String visitClass(CONSTANT_Class_info c, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        try {
            value = visit(cfpool.get(c.name_index), c.name_index);
            slist.set(p, value);
            xpool.add(new Element("CONSTANT_Class", 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 19 with Element

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

the class AnnotationsElementVisitor method visitStackMapTable.

@Override
public Element visitStackMapTable(StackMapTable_attribute smt, Element p) {
    Element stackmap = new Element(x.getCpString(smt.attribute_name_index));
    for (StackMapTable_attribute.stack_map_frame f : smt.entries) {
        StackMapVisitor smv = new StackMapVisitor(x, cf, stackmap);
        stackmap.add(smv.visit(f));
    }
    stackmap.trimToSize();
    p.add(stackmap);
    return null;
}
Also used : StackMapTable_attribute(com.sun.tools.classfile.StackMapTable_attribute) Element(xmlkit.XMLKit.Element)

Example 20 with Element

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

the class AnnotationsElementVisitor method visitArray.

@Override
public Element visitArray(Array_element_value a, Element p) {
    Element el = new Element("Array");
    for (Annotation.element_value v : a.values) {
        Element child = visit(v, el);
        if (child != null) {
            el.add(child);
        }
    }
    el.trimToSize();
    return el;
}
Also used : Element(xmlkit.XMLKit.Element) TypeAnnotation(com.sun.tools.classfile.TypeAnnotation) Annotation(com.sun.tools.classfile.Annotation)

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