use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitArrayType.
@Override
public Element visitArrayType(Instruction i, TypeKind tk, Void p) {
Element ie = new Element(i.getMnemonic());
ie.setAttr("num", "" + tk.value);
ie.setAttr("val", tk.name);
return ie;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitMethodType.
@Override
public String visitMethodType(CONSTANT_MethodType_info c, Integer p) {
String value = slist.get(p);
if (value == null) {
try {
value = visit(cfpool.get(c.descriptor_index), c.descriptor_index);
slist.set(p, value);
xpool.add(new Element("CONSTANT_MethodType", 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 visitLineNumberTable.
@Override
public Element visitLineNumberTable(LineNumberTable_attribute lnt, Element p) {
String name = x.getCpString(lnt.attribute_name_index);
for (LineNumberTable_attribute.Entry e : lnt.line_number_table) {
Element l = new Element(name);
l.setAttr("bci", "" + e.start_pc);
l.setAttr("line", "" + e.line_number);
l.trimToSize();
p.add(l);
}
// already added to parent
return null;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitLookupSwitch.
@Override
public Element visitLookupSwitch(Instruction i, int i1, int i2, int[] ints, int[] ints1, Void p) {
Element ie = new Element(i.getMnemonic());
int pc = i.getPC();
ie.setAttr("lab", "" + (pc + i1));
for (int k = 0; k < i2; k++) {
Element c = new Element("Case");
c.setAttr("num", "" + (ints[k]));
c.setAttr("lab", "" + (pc + ints1[k]));
c.trimToSize();
ie.add(c);
}
return ie;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitBootstrapMethods.
@Override
public Element visitBootstrapMethods(BootstrapMethods_attribute bm, Element p) {
Element e = new Element(x.getCpString(bm.attribute_name_index));
for (BootstrapMethods_attribute.BootstrapMethodSpecifier bsm : bm.bootstrap_method_specifiers) {
Element be = new Element("BootstrapMethodSpecifier");
be.setAttr("ref", x.getCpString(bsm.bootstrap_method_ref));
if (bsm.bootstrap_arguments.length > 0) {
Element bme = new Element("MethodArguments");
for (int index : bsm.bootstrap_arguments) {
bme.add(x.getCpString(index));
}
bme.trimToSize();
be.add(bme);
}
be.trimToSize();
e.add(be);
}
e.trimToSize();
if (!x.keepOrder) {
e.sort();
}
p.add(e);
return null;
}
Aggregations