Search in sources :

Example 31 with Element

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

the class AnnotationsElementVisitor method visitUtf8.

@Override
public String visitUtf8(CONSTANT_Utf8_info cnstnt, Integer p) {
    String value = slist.get(p);
    if (value == null) {
        value = cnstnt.value;
        slist.set(p, value);
        xpool.add(new Element("CONSTANT_Utf8", new String[] { "id", p.toString() }, value));
    }
    return value;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 32 with Element

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

the class AnnotationsElementVisitor method visitEnum.

@Override
public Element visitEnum(Enum_element_value e, Element p) {
    Element el = new Element("Enum");
    el.setAttr("name", x.getCpString(e.const_name_index));
    el.setAttr("type", x.getCpString(e.type_name_index));
    el.trimToSize();
    return el;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 33 with Element

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

the class AnnotationsElementVisitor method visit_full_frame.

@Override
public Element visit_full_frame(full_frame fl_frm, Void p) {
    Element e = new Element("FullFrame");
    e.setAttr("tag", "" + fl_frm.frame_type);
    e.addAll(getVerificationTypeInfo("Local", fl_frm.locals));
    e.trimToSize();
    return e;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 34 with Element

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

the class AnnotationsElementVisitor method visitRuntimeVisibleAnnotations.

@Override
public Element visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute rva, Element p) {
    Element e = new Element(x.getCpString(rva.attribute_name_index));
    parseAnnotations(rva.annotations, e);
    e.trimToSize();
    p.add(e);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 35 with Element

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

the class AnnotationsElementVisitor method parseAnnotation.

private void parseAnnotation(Annotation anno, Element p) {
    Element ea = new Element("Annotation");
    ea.setAttr("name", "" + x.getCpString(anno.type_index));
    for (Annotation.element_value_pair evp : anno.element_value_pairs) {
        Element evpe = new Element("Element");
        evpe.setAttr("tag", "" + evp.value.tag);
        evpe.setAttr("value", x.getCpString(evp.element_name_index));
        Element child = aev.visit(evp.value, evpe);
        if (child != null) {
            evpe.add(child);
        }
        ea.add(evpe);
    }
    ea.trimToSize();
    p.add(ea);
}
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