Java Code Examples for xmlkit.XMLKit.Element#trimToSize()

The following examples show how to use xmlkit.XMLKit.Element#trimToSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClassReader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: ClassReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 3
Source File: ClassReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
    return null; // already added to parent
}
 
Example 4
Source File: ClassReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 5
Source File: ClassReader.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitSourceFile(SourceFile_attribute sf, Element p) {
    String aname = x.getCpString(sf.attribute_name_index);
    String sname = x.getCpString(sf.sourcefile_index);
    Element se = new Element(aname);
    se.add(sname);
    se.trimToSize();
    p.add(se);
    return null;
}
 
Example 6
Source File: ClassReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 7
Source File: ClassReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitSourceFile(SourceFile_attribute sf, Element p) {
    String aname = x.getCpString(sf.attribute_name_index);
    String sname = x.getCpString(sf.sourcefile_index);
    Element se = new Element(aname);
    se.add(sname);
    se.trimToSize();
    p.add(se);
    return null;
}
 
Example 8
Source File: ClassReader.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visit_append_frame(append_frame a, Void p) {
   Element e = new Element("AppendFrame" + (a.frame_type - 251));
   e.setAttr("tag", "" + a.frame_type);
   e.addAll(getVerificationTypeInfo("Local", a.locals));
   e.trimToSize();
   return e;
}
 
Example 9
Source File: ClassReader.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitClass(Class_element_value c, Element p) {
    Element el = new Element("Class");
    el.setAttr("name", x.getCpString(c.class_info_index));
    el.trimToSize();
    return el;
}
 
Example 10
Source File: ClassReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visit_full_frame(full_frame fl_frm, Void p) {
     Element e = new Element("FullFrame");
     e.setAttr("tag", "" + fl_frm.frame_type);
     e.addAll(getVerificationTypeInfo("Local", fl_frm.locals));
     e.trimToSize();
     return e;
}
 
Example 11
Source File: ClassReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 12
Source File: ClassReader.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitAnnotationDefault(AnnotationDefault_attribute ad, Element p) {
    Element e = new Element(x.getCpString(ad.attribute_name_index));
    e.setAttr("tag", "" + ad.default_value.tag);
    Element child = aev.visit(ad.default_value, e);
    if (child != null) {
        e.add(child);
    }
    e.trimToSize();
    p.add(e);
    return null;
}
 
Example 13
Source File: ClassReader.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 14
Source File: ClassReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitSignature(Signature_attribute s, Element p) {
    String aname = x.getCpString(s.attribute_name_index);
    String sname = x.getCpString(s.signature_index);
    Element se = new Element(aname);
    se.add(sname);
    se.trimToSize();
    p.add(se);
    return null;
}
 
Example 15
Source File: ClassReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visit_full_frame(full_frame fl_frm, Void p) {
     Element e = new Element("FullFrame");
     e.setAttr("tag", "" + fl_frm.frame_type);
     e.addAll(getVerificationTypeInfo("Local", fl_frm.locals));
     e.trimToSize();
     return e;
}
 
Example 16
Source File: ClassReader.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitEnclosingMethod(EnclosingMethod_attribute em, Element p) {
    Element e = new Element(x.getCpString(em.attribute_name_index));
    e.setAttr("class", x.getCpString(em.class_index));
    e.setAttr("desc", x.getCpString(em.method_index));
    e.trimToSize();
    p.add(e);
    return null;
}
 
Example 17
Source File: ClassReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visit_append_frame(append_frame a, Void p) {
   Element e = new Element("AppendFrame" + (a.frame_type - 251));
   e.setAttr("tag", "" + a.frame_type);
   e.addAll(getVerificationTypeInfo("Local", a.locals));
   e.trimToSize();
   return e;
}
 
Example 18
Source File: ClassReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 19
Source File: ClassReader.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitAnnotationDefault(AnnotationDefault_attribute ad, Element p) {
    Element e = new Element(x.getCpString(ad.attribute_name_index));
    e.setAttr("tag", "" + ad.default_value.tag);
    Element child = aev.visit(ad.default_value, e);
    if (child != null) {
        e.add(child);
    }
    e.trimToSize();
    p.add(e);
    return null;
}
 
Example 20
Source File: ClassReader.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Element visitSynthetic(Synthetic_attribute s, Element p) {
    Element e = new Element(x.getCpString(s.attribute_name_index));
    e.trimToSize();
    p.add(e);
    return null;
}