Scan one or more specific classes, without scanning other classes in the same package unless the package is
itself accepted.
Accept classpath elements based on resource paths.
Accept one or more jars in a JRE/JDK "lib/" or "ext/" directory (these directories are not scanned unless
enableSystemJarsAndModules()
is called, by association with the JRE/JDK).
Accept one or more modules for scanning.
Scan one or more specific packages and their sub-packages.
Scan one or more specific packages, without recursively scanning sub-packages unless they are themselves
accepted.
Scan one or more specific paths, and their sub-directories or nested paths.
Scan one or more specific paths, without recursively scanning sub-directories or nested paths unless they are
themselves accepted.
Add a ClassLoader to the list of ClassLoaders to scan.
Add a ModuleLayer to the list of ModuleLayers to scan.
Disables the scanning of directories.
Disables the scanning of jarfiles.
Disables the scanning of modules.
Disables the scanning of nested jarfiles (jarfiles within jarfiles).
Causes only runtime visible annotations to be scanned (causes runtime invisible annotations to be ignored).
Enables the scanning of all classes, fields, methods, annotations, and static final field constant
initializer values, and ignores all visibility modifiers, so that both public and non-public classes, fields
and methods are all scanned.
Enables the saving of annotation info (for class, field, method and method parameter annotations) during the
scan.
Causes ClassGraph to return classes that are not in the accepted packages, but that are directly referred to
by classes within accepted packages as a superclass, implemented interface or annotation.
Enables the saving of field info during the scan.
If true, use a
MappedByteBuffer
rather than the
FileChannel
API to open files, which may be
faster for large classpaths consisting of many large jarfiles, but uses up virtual memory space.
Enables the saving of method info during the scan.
If true, provide all versions of a multi-release resource using their multi-release path prefix, instead of
just the one the running JVM would select.
Enables logging by calling
verbose()
, and then sets the logger to "realtime logging mode", where log
entries are written out immediately to stderr, rather than only after the scan has completed.
Enable classpath elements to be fetched from remote ("http:"/"https:") URLs (or URLs with custom schemes).
Enables the saving of static final field constant initializer values.
Enables the scanning of system packages ("java.*"
, "javax.*"
, "javafx.*"
,
"jdk.*"
, "oracle.*"
, "sun.*"
) -- these are not scanned by default for speed.
Enable classpath elements to be fetched from
URL
connections with the specified URL scheme (also
works for any custom URL schemes that have been defined, as long as they have more than two characters, in
order to not conflict with Windows drive letters).
Add a classpath element filter.
Add a classpath element filter.
Causes class visibility to be ignored, enabling private, package-private and protected classes to be scanned.
Causes field visibility to be ignored, enabling private, package-private and protected fields to be scanned.
Causes method visibility to be ignored, enabling private, package-private and protected methods to be
scanned.
Ignore parent classloaders (i.e.
Ignore parent module layers (i.e.
Causes classes loaded using
ClassInfo.loadClass()
to be are initialized after class loading (the
default is to not initialize classes).
Completely override (and ignore) system ClassLoaders and the java.class.path system property.
Override the automatically-detected classpath with a custom path.
Override the automatically-detected classpath with a custom path.
Override the automatically-detected classpath with a custom path, with path elements separated by
File.pathSeparatorChar.
Completely override (and ignore) the visible ModuleLayers, and instead scan the requested ModuleLayers.
Specifically reject one or more specific classes, preventing them from being scanned even if they are in a
accepted package.
Reject classpath elements based on resource paths.
Reject one or more jars, preventing them from being scanned.
Reject one or more jars in a JRE/JDK "lib/" or "ext/" directory, preventing them from being scanned.
Reject one or more modules, preventing them from being scanned.
Prevent the scanning of one or more specific packages and their sub-packages.
Prevent the scanning of one or more specific paths and their sub-directories / nested paths.
Remove temporary files, including nested jarfiles (jarfiles within jarfiles, which have to be extracted
during scanning in order to be read) from their temporary directory as soon as the scan has completed.
The maximum size of an inner (nested) jar that has been deflated (i.e.
Switches on verbose logging to System.err.
ClassGraph.verbose(boolean verbose)
Switches on verbose logging to System.err if verbose is true.
rejectClasses(String...)
instead.