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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations