Search in sources :

Example 21 with Element

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

the class AnnotationsElementVisitor method visitAnnotation.

@Override
public Element visitAnnotation(Annotation_element_value a, Element p) {
    Element el = new Element("Annotation");
    Annotation anno = a.annotation_value;
    for (Annotation.element_value_pair evp : anno.element_value_pairs) {
        Element child = visit(evp.value, 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)

Example 22 with Element

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

the class AnnotationsElementVisitor method visitInnerClasses.

@Override
public Element visitInnerClasses(InnerClasses_attribute ic, Element p) {
    for (Info info : ic.classes) {
        Element e = new Element(x.getCpString(ic.attribute_name_index));
        e.setAttr("class", x.getCpString(info.inner_class_info_index));
        e.setAttr("outer", x.getCpString(info.outer_class_info_index));
        e.setAttr("name", x.getCpString(info.inner_name_index));
        e.setAttr("flags", x.flagString(info.inner_class_access_flags, "InnerClass"));
        e.trimToSize();
        p.add(e);
    }
    return null;
}
Also used : Element(xmlkit.XMLKit.Element) Info(com.sun.tools.classfile.InnerClasses_attribute.Info)

Example 23 with Element

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

the class AnnotationsElementVisitor method visitExceptions.

@Override
public Element visitExceptions(Exceptions_attribute e, Element p) {
    Element ee = new Element(x.getCpString(e.attribute_name_index));
    for (int idx : e.exception_index_table) {
        Element n = new Element("Item");
        n.setAttr("class", x.getCpString(idx));
        ee.add(n);
    }
    ee.trimToSize();
    p.add(ee);
    return null;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 24 with Element

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

the class AnnotationsElementVisitor method visit_chop_frame.

@Override
public Element visit_chop_frame(chop_frame c, Void p) {
    Element e = new Element("Chop" + (251 - c.frame_type));
    e.setAttr("tag", "" + c.frame_type);
    e.setAttr("offset", "" + c.offset_delta);
    return e;
}
Also used : Element(xmlkit.XMLKit.Element)

Example 25 with Element

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

the class AnnotationsElementVisitor method visitCompilationID.

@Override
public Element visitCompilationID(CompilationID_attribute cid, Element p) {
    Element e = new Element(x.getCpString(cid.attribute_name_index), x.getCpString(cid.compilationID_index));
    p.add(e);
    return null;
}
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