Package eu.bandm.tools.util.classes
Class ClassProbe
java.lang.Object
eu.bandm.tools.util.classes.ClassProbe
Defines static methods for finding recursive static references to
classes via breadth-first search.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String>
Delivers a list of all class names which are referred in the input.static Collection<String>
findClasses
(@Opt String targetClassPath, @Opt Predicate<? super String> filter, @Opt BiConsumer<String, Exception> signalLoadingError, String... roots) Find all recursive static references to classes.static Collection<String>
unpackArrayTypes
(Collection<String> types)
-
Method Details
-
extractClassNames
Delivers a list of all class names which are referred in the input.- Parameters:
in
- the class data conformant to a valid class file as defined by The Java™ Virtual Machine Specification.- Throws:
IOException
-
findClasses
public static Collection<String> findClasses(@Opt @Opt String targetClassPath, @Opt @Opt Predicate<? super String> filter, @Opt @Opt BiConsumer<String, Exception> signalLoadingError, String... roots) Find all recursive static references to classes.- Parameters:
targetClassPath
- the class path to use for loading the referenced classes, ornull
for the system class path.filter
- a predicate to filter the class references. References to classes that are not accepted by this predicate are not loaded or traversed. The predicatenull
accepts anything.signalLoadingError
- when given, signalLoadingError receives class name and exception on trying to load the code of that classroots
- references to classes to start with, given as binary names.
-
unpackArrayTypes
-