Search in sources :

Example 1 with DescendingVisitor

use of org.apache.bcel.classfile.DescendingVisitor in project jop by jop-devel.

the class OldAppInfo method iterate.

/**
	 * Iterate over all classes and run the visitor.
	 * 
	 * @param v
	 */
public void iterate(Visitor v) {
    Iterator<? extends OldClassInfo> it = cliMap.values().iterator();
    while (it.hasNext()) {
        JavaClass clz = it.next().clazz;
        new DescendingVisitor(clz, v).visit();
    }
}
Also used : JavaClass(org.apache.bcel.classfile.JavaClass) DescendingVisitor(org.apache.bcel.classfile.DescendingVisitor)

Example 2 with DescendingVisitor

use of org.apache.bcel.classfile.DescendingVisitor in project jop by jop-devel.

the class OldClassInfo method genClassInfoMap.

/**
	 * Create ClassInfos and the map from class names to ClassInfo
	 * @param jc
	 * @return
	 */
Map<String, ? extends OldClassInfo> genClassInfoMap(JavaClass[] jc, OldAppInfo ai) {
    Map<String, OldClassInfo> map = new HashMap<String, OldClassInfo>();
    for (int i = 0; i < jc.length; ++i) {
        OldClassInfo cli = newClassInfo(jc[i], ai);
        map.put(cli.clazz.getClassName(), cli);
    }
    // second iteration over all class infos for additional information setting
    CliVisitor v = newCliVisitor(map);
    Iterator<? extends OldClassInfo> it = map.values().iterator();
    while (it.hasNext()) {
        JavaClass clz = it.next().clazz;
        new DescendingVisitor(clz, v).visit();
    }
    return map;
}
Also used : JavaClass(org.apache.bcel.classfile.JavaClass) HashMap(java.util.HashMap) DescendingVisitor(org.apache.bcel.classfile.DescendingVisitor)

Aggregations

DescendingVisitor (org.apache.bcel.classfile.DescendingVisitor)2 JavaClass (org.apache.bcel.classfile.JavaClass)2 HashMap (java.util.HashMap)1