Search in sources :

Example 46 with Element

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

the class AnnotationsElementVisitor method visitUnknown.

@Override
public Element visitUnknown(Instruction i, Void p) {
    Element e = new Element(i.getMnemonic());
    e.setAttr("pc", "" + i.getPC());
    e.setAttr("opcode", "" + i.getOpcode().opcode);
    return e;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 47 with Element

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

the class AnnotationsElementVisitor method parseTypeAnnotations.

private void parseTypeAnnotations(TypeAnnotation pa, Element p) {
    Element pta = new Element("RuntimeVisibleTypeAnnotation");
    p.add(pta);
    Position pos = pa.position;
    parsePosition(pos, pta);
    parseAnnotation(pa.annotation, pta);
}
Also used : Position(com.sun.tools.classfile.TypeAnnotation.Position) Element(xmlkit.XMLKit.Element)

Example 48 with Element

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

the class AnnotationsElementVisitor method visitCode.

@Override
public Element visitCode(Code_attribute c, Element p) {
    Element e = null;
    e = new Element(x.getCpString(c.attribute_name_index), "stack", "" + c.max_stack, "local", "" + c.max_locals);
    e.add(instructions(e, c));
    for (Code_attribute.Exception_data edata : c.exception_table) {
        e.add(new Element("Handler", "start", "" + edata.start_pc, "end", "" + edata.end_pc, "catch", "" + edata.handler_pc, "class", x.getCpString(edata.catch_type)));
    }
    this.x.readAttributesFor(cf, c.attributes, e);
    e.trimToSize();
    p.add(e);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element) Code_attribute(com.sun.tools.classfile.Code_attribute)

Example 49 with Element

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

the class AnnotationsElementVisitor method visitMethodHandle.

@Override
public String visitMethodHandle(CONSTANT_MethodHandle_info c, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        try {
            value = c.reference_kind.name();
            value = value.concat(" " + visit(cfpool.get(c.reference_index), c.reference_index));
            slist.set(p, value);
            xpool.add(new Element("CONSTANT_MethodHandle", 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 50 with Element

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

the class AnnotationsElementVisitor method visitLong.

@Override
public String visitLong(CONSTANT_Long_info c, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        value = Long.toString(c.value);
        slist.set(p, value);
        xpool.add(new Element("CONSTANT_Long", new String[] { "id", p.toString() }, value));
    }
    return value;
}
Also used : Element(xmlkit.XMLKit.Element)

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