use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitCharacterRangeTable.
@Override
public Element visitCharacterRangeTable(CharacterRangeTable_attribute crt, Element p) {
Element e = new Element(x.getCpString(crt.attribute_name_index));
for (CharacterRangeTable_attribute.Entry ce : crt.character_range_table) {
e.setAttr("start_pc", "" + ce.start_pc);
e.setAttr("end_pc", "" + ce.end_pc);
e.setAttr("range_start", "" + ce.character_range_start);
e.setAttr("range_end", "" + ce.character_range_end);
e.setAttr("flags", x.flagString(ce.flags, "Method"));
}
e.trimToSize();
p.add(e);
return null;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitDouble.
@Override
public String visitDouble(CONSTANT_Double_info c, Integer p) {
String value = slist.get(p);
if (value == null) {
value = Double.toString(c.value);
slist.set(p, value);
xpool.add(new Element("CONSTANT_Double", new String[] { "id", p.toString() }, value));
}
return value;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method readCP.
private void readCP(ClassFile c) throws IOException {
cpool = new Element("ConstantPool", c.constant_pool.size());
ConstantPoolVisitor cpv = new ConstantPoolVisitor(cpool, c, c.constant_pool.size());
for (int i = 1; i < c.constant_pool.size(); i++) {
try {
cpv.visit(c.constant_pool.get(i), i);
} catch (InvalidIndex ex) {
// can happen periodically when accessing doubles etc. ignore it
// ex.printStackTrace();
}
}
thePool = cpv.getPoolList();
if (verbose) {
for (int i = 0; i < thePool.size(); i++) {
System.out.println("[" + i + "]: " + thePool.get(i));
}
}
if (keepCP) {
cfile.add(cpool);
}
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visit_same_locals_1_stack_item_frame_extended.
@Override
public Element visit_same_locals_1_stack_item_frame_extended(same_locals_1_stack_item_frame_extended s, Void p) {
Element e = new Element("SameLocals1StackItemFrameExtended");
e.setAttr("tag", "" + s.frame_type);
e.addAll(getVerificationTypeInfo("Stack", s.stack));
e.trimToSize();
return e;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitLocalVariableTable.
@Override
public Element visitLocalVariableTable(LocalVariableTable_attribute lvt, Element p) {
String name = x.getCpString(lvt.attribute_name_index);
for (LocalVariableTable_attribute.Entry e : lvt.local_variable_table) {
Element l = new Element(name);
l.setAttr("bci", "" + e.start_pc);
l.setAttr("span", "" + e.length);
l.setAttr("name", x.getCpString(e.name_index));
l.setAttr("type", x.getCpString(e.descriptor_index));
l.setAttr("slot", "" + e.index);
l.trimToSize();
p.add(l);
}
// already added to parent
return null;
}
Aggregations