proguard.classfile.visitor.ClassCollector Java Examples

The following examples show how to use proguard.classfile.visitor.ClassCollector. 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: ClassMerger.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the set of indirectly implemented interfaces.
 */
private Set indirectlyImplementedInterfaces(Clazz clazz)
{
    Set set = new HashSet();

    ReferencedClassVisitor referencedInterfaceCollector =
        new ReferencedClassVisitor(
        new ClassHierarchyTraveler(false, false, true, false,
        new ClassCollector(set)));

    // Visit all superclasses and  collect their interfaces.
    clazz.superClassConstantAccept(referencedInterfaceCollector);

    // Visit all interfaces and collect their interfaces.
    clazz.interfaceConstantsAccept(referencedInterfaceCollector);

    return set;
}
 
Example #2
Source File: SideEffectClassChecker.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses and interfaces that are initialized.
 */
private static Set sideEffectSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses and interfaces, collecting the ones that have
    // side effects when they are initialized.
    clazz.hierarchyAccept(true, true, true, false,
                          new SideEffectClassFilter(
                          new ClassCollector(set)));

    return set;
}
 
Example #3
Source File: SideEffectInstructionChecker.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses and interfaces that are initialized.
 */
private Set initializedSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses and interfaces, collecting the ones that have
    // static initializers.
    clazz.hierarchyAccept(true, true, true, false,
                          new StaticInitializerContainingClassFilter(
                          new ClassCollector(set)));

    return set;
}
 
Example #4
Source File: ClassMerger.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses and interfaces that are initialized.
 */
private Set initializedSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses and interfaces, collecting the ones that have
    // static initializers.
    clazz.hierarchyAccept(true, true, true, false,
                          new StaticInitializerContainingClassFilter(
                          new ClassCollector(set)));

    return set;
}
 
Example #5
Source File: ClassMerger.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses and interfaces that are used in
 * 'instanceof' tests.
 */
private Set instanceofedSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses and interfaces, collecting the ones that are
    // used in an 'instanceof' test.
    clazz.hierarchyAccept(true, true, true, false,
                          new InstanceofClassFilter(
                          new ClassCollector(set)));

    return set;
}
 
Example #6
Source File: ClassMerger.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses that are caught as exceptions.
 */
private Set caughtSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses, collecting the ones that are caught.
    clazz.hierarchyAccept(true, true, false, false,
                          new CaughtClassFilter(
                          new ClassCollector(set)));

    return set;
}
 
Example #7
Source File: MethodInliner.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the set of superclasses and interfaces that are initialized.
 */
private Set initializedSuperClasses(Clazz clazz)
{
    Set set = new HashSet();

    // Visit all superclasses and interfaces, collecting the ones that have
    // static initializers.
    clazz.hierarchyAccept(true, true, true, false,
                          new StaticInitializerContainingClassFilter(
                          new ClassCollector(set)));

    return set;
}