Java Code Examples for proguard.classfile.ClassPool#classNames()

The following examples show how to use proguard.classfile.ClassPool#classNames() . These examples are extracted from open source projects. 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
/**
 * Creates a map of old package prefixes to new package prefixes, based on
 * the given class pool.
 */
private static Map createPackagePrefixMap(ClassPool classPool)
{
    Map packagePrefixMap = new HashMap();

    Iterator iterator = classPool.classNames();
    while (iterator.hasNext())
    {
        String className     = (String)iterator.next();
        String packagePrefix = ClassUtil.internalPackagePrefix(className);

        String mappedNewPackagePrefix = (String)packagePrefixMap.get(packagePrefix);
        if (mappedNewPackagePrefix == null ||
            !mappedNewPackagePrefix.equals(packagePrefix))
        {
            String newClassName     = classPool.getClass(className).getName();
            String newPackagePrefix = ClassUtil.internalPackagePrefix(newClassName);

            packagePrefixMap.put(packagePrefix, newPackagePrefix);
        }
    }

    return packagePrefixMap;
}
 
Example 2
/**
 * Creates a map of old package prefixes to new package prefixes, based on
 * the given class pool.
 */
private static Map createPackagePrefixMap(ClassPool classPool)
{
    Map packagePrefixMap = new HashMap();

    Iterator iterator = classPool.classNames();
    while (iterator.hasNext())
    {
        String className     = (String)iterator.next();
        String packagePrefix = ClassUtil.internalPackagePrefix(className);

        String mappedNewPackagePrefix = (String)packagePrefixMap.get(packagePrefix);
        if (mappedNewPackagePrefix == null ||
            !mappedNewPackagePrefix.equals(packagePrefix))
        {
            String newClassName     = classPool.getClass(className).getName();
            String newPackagePrefix = ClassUtil.internalPackagePrefix(newClassName);

            packagePrefixMap.put(packagePrefix, newPackagePrefix);
        }
    }

    return packagePrefixMap;
}
 
Example 3
/**
 * Creates a map of old package prefixes to new package prefixes, based on
 * the given class pool.
 */
private static Map createPackagePrefixMap(ClassPool classPool)
{
    Map packagePrefixMap = new HashMap();

    Iterator iterator = classPool.classNames();
    while (iterator.hasNext())
    {
        String className     = (String)iterator.next();
        String packagePrefix = ClassUtil.internalPackagePrefix(className);

        String mappedNewPackagePrefix = (String)packagePrefixMap.get(packagePrefix);
        if (mappedNewPackagePrefix == null ||
            !mappedNewPackagePrefix.equals(packagePrefix))
        {
            String newClassName     = classPool.getClass(className).getName();
            String newPackagePrefix = ClassUtil.internalPackagePrefix(newClassName);

            packagePrefixMap.put(packagePrefix, newPackagePrefix);
        }
    }

    return packagePrefixMap;
}
 
Example 4
Source Project: bazel   File: OutputWriter.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a map of old package prefixes to new package prefixes, based on
 * the given class pool.
 */
private static Map createPackagePrefixMap(ClassPool classPool)
{
    Map packagePrefixMap = new HashMap();

    Iterator iterator = classPool.classNames();
    while (iterator.hasNext())
    {
        String className     = (String)iterator.next();
        String packagePrefix = ClassUtil.internalPackagePrefix(className);

        String mappedNewPackagePrefix = (String)packagePrefixMap.get(packagePrefix);
        if (mappedNewPackagePrefix == null ||
            !mappedNewPackagePrefix.equals(packagePrefix))
        {
            String newClassName     = classPool.getClass(className).getName();
            String newPackagePrefix = ClassUtil.internalPackagePrefix(newClassName);

            packagePrefixMap.put(packagePrefix, newPackagePrefix);
        }
    }

    return packagePrefixMap;
}