use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method readAttributesFor.
protected void readAttributesFor(ClassFile c, Attributes attrs, Element x) {
Element container = new Element();
AttributeVisitor av = new AttributeVisitor(this, c);
for (Attribute a : attrs) {
av.visit(a, container);
}
if (!keepOrder) {
container.sort();
}
x.addAll(container);
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visit.
public Element visit(Instruction i) {
Element ie = i.accept(this, null);
ie.trimToSize();
return ie;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method getVerificationTypeInfo.
private Element getVerificationTypeInfo(String kind, StackMapTable_attribute.verification_type_info[] velems) {
Element container = new Element(velems.length);
for (StackMapTable_attribute.verification_type_info v : velems) {
Element ve = null;
int offset = 0;
int index = 0;
switch(v.tag) {
case StackMapTable_attribute.verification_type_info.ITEM_Top:
ve = new Element("ITEM_Top");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Integer:
ve = new Element("ITEM_Integer");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Float:
ve = new Element("ITEM_Float");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Long:
ve = new Element("ITEM_Long");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Double:
ve = new Element("ITEM_Double");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Null:
ve = new Element("ITEM_Null");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Uninitialized:
ve = new Element("ITEM_Uninitialized");
offset = ((StackMapTable_attribute.Uninitialized_variable_info) v).offset;
ve.setAttr("offset", "" + offset);
break;
case StackMapTable_attribute.verification_type_info.ITEM_UninitializedThis:
ve = new Element("ITEM_UnitializedtThis");
break;
case StackMapTable_attribute.verification_type_info.ITEM_Object:
ve = new Element("ITEM_Object");
index = ((StackMapTable_attribute.Object_variable_info) v).cpool_index;
ve.setAttr("class", x.getCpString(index));
break;
default:
ve = new Element("Unknown");
}
Element kindE = new Element(kind);
kindE.setAttr("tag", "" + v.tag);
container.add(kindE);
kindE.add(ve);
}
container.trimToSize();
return container;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitTableSwitch.
@Override
public Element visitTableSwitch(Instruction i, int i1, int i2, int i3, int[] ints, Void p) {
Element ie = new Element(i.getMnemonic());
int pc = i.getPC();
ie.setAttr("lab", "" + (pc + i1));
for (int k : ints) {
Element c = new Element("Case");
c.setAttr("num", "" + (k + i2));
c.setAttr("lab", "" + (pc + k));
c.trimToSize();
ie.add(c);
}
return ie;
}
use of xmlkit.XMLKit.Element in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitSourceID.
@Override
public Element visitSourceID(SourceID_attribute sid, Element p) {
Element e = new Element(x.getCpString(sid.attribute_name_index));
e.add(x.getCpString(sid.sourceID_index));
e.trimToSize();
p.add(e);
return null;
}
Aggregations