Class FilteredClassLoader


  • public class FilteredClassLoader
    extends ClassLoader
    A ClassLoader that filters out certain classes (by name) and throws a ClassNotFoundException when they should be loaded.

    This utility is useful when trying to eliminate certain classes from a class loader force loading them through another class loader.

    • Constructor Detail

      • FilteredClassLoader

        public FilteredClassLoader​(ClassLoader delegate,
                                   String... filteredClassNames)
        Creates a new filtered classloader.
        Parameters:
        delegate - The class loader that is filtered by this classloader.
        filteredClassNames - The class names to filter out.