An uber-fast, ultra-lightweight Java classpath scanner, module scanner, and annotation processor.
Java
Switch branches/tags
fast-classpath-scanner-4.0.0-beta-10 fast-classpath-scanner-4.0.0-beta-10b fast-classpath-scanner-4.0.0-beta-9 fast-classpath-scanner-4.0.0-beta-8 fast-classpath-scanner-4.0.0-beta-7 fast-classpath-scanner-4.0.0-beta-6 fast-classpath-scanner-4.0.0-beta-5 fast-classpath-scanner-4.0.0-beta-4 fast-classpath-scanner-4.0.0-beta-3 fast-classpath-scanner-4.0.0-beta-2 fast-classpath-scanner-4.0.0-beta-1 fast-classpath-scanner-3.1.15 fast-classpath-scanner-3.1.14 fast-classpath-scanner-3.1.13 fast-classpath-scanner-3.1.12 fast-classpath-scanner-3.1.11 fast-classpath-scanner-3.1.10 fast-classpath-scanner-3.1.9 fast-classpath-scanner-3.1.8 fast-classpath-scanner-3.1.7 fast-classpath-scanner-3.1.6 fast-classpath-scanner-3.1.5 fast-classpath-scanner-3.1.4 fast-classpath-scanner-3.1.3 fast-classpath-scanner-3.1.2 fast-classpath-scanner-3.1.1 fast-classpath-scanner-3.1.0 fast-classpath-scanner-3.0.3 fast-classpath-scanner-3.0.2 fast-classpath-scanner-3.0.1 fast-classpath-scanner-3.0.0 fast-classpath-scanner-2.21 fast-classpath-scanner-2.20.2 fast-classpath-scanner-2.20.1 fast-classpath-scanner-2.20.0 fast-classpath-scanner-2.19.0 fast-classpath-scanner-2.18.2 fast-classpath-scanner-2.18.1 fast-classpath-scanner-2.18.0 fast-classpath-scanner-2.16.0 fast-classpath-scanner-2.14.1 fast-classpath-scanner-2.14.0 fast-classpath-scanner-2.12.6 fast-classpath-scanner-2.12.5 fast-classpath-scanner-2.12.4 fast-classpath-scanner-2.12.3 fast-classpath-scanner-2.12.2 fast-classpath-scanner-2.12.1 fast-classpath-scanner-2.12.0 fast-classpath-scanner-2.11.1 fast-classpath-scanner-2.11.0 fast-classpath-scanner-2.10.0 fast-classpath-scanner-2.9.5 fast-classpath-scanner-2.9.4 fast-classpath-scanner-2.9.3 fast-classpath-scanner-2.9.2 fast-classpath-scanner-2.9.1 fast-classpath-scanner-2.9.0 fast-classpath-scanner-2.8.2 fast-classpath-scanner-2.8.1 fast-classpath-scanner-2.8.0 fast-classpath-scanner-2.7.5 fast-classpath-scanner-2.7.4 fast-classpath-scanner-2.7.3 fast-classpath-scanner-2.7.2 fast-classpath-scanner-2.7.1 fast-classpath-scanner-2.7.0 fast-classpath-scanner-2.6.2 fast-classpath-scanner-2.6.1 fast-classpath-scanner-2.6.0 fast-classpath-scanner-2.4.7 fast-classpath-scanner-2.4.6 fast-classpath-scanner-2.4.5 fast-classpath-scanner-2.4.4 fast-classpath-scanner-2.4.3 fast-classpath-scanner-2.4.2 fast-classpath-scanner-2.4.1 fast-classpath-scanner-2.4.0 fast-classpath-scanner-2.2.1 fast-classpath-scanner-2.2.0 fast-classpath-scanner-2.0.22 fast-classpath-scanner-2.0.21 fast-classpath-scanner-2.0.20 fast-classpath-scanner-2.0.19 fast-classpath-scanner-2.0.18 fast-classpath-scanner-2.0.17 fast-classpath-scanner-2.0.16 fast-classpath-scanner-2.0.15 fast-classpath-scanner-2.0.14 fast-classpath-scanner-2.0.13 fast-classpath-scanner-2.0.12 fast-classpath-scanner-2.0.11 fast-classpath-scanner-2.0.10 fast-classpath-scanner-2.0.9 fast-classpath-scanner-2.0.8 fast-classpath-scanner-2.0.7 fast-classpath-scanner-2.0.6 fast-classpath-scanner-2.0.5 fast-classpath-scanner-2.0.4 fast-classpath-scanner-2.0.3
Nothing to show
Clone or download
Latest commit b819c9e Aug 9, 2018

README.md

ClassGraph

Build Status Maven Central Javadocs Gitter

ClassGraph Logo

ClassGraph (formerly FastClasspathScanner) is an uber-fast, ultra-lightweight classpath scanner, module scanner, and annotation processor for Java, Scala, Kotlin and other JVM languages.

ClassGraph has the ability to "invert" the Java class and/or reflection API: for example, the Java class and reflection API can tell you the interfaces implemented by a given class, or can give you the list of annotations on a class; ClassGraph can find all classes that implement a given interface, or can find all classes that are annotated with a given annotation.

ClassGraph provides a number of important capabilities to the JVM ecosystem:

  • ClassGraph has the ability to build a model in memory of the entire relatedness graph of all classes, annotations, interfaces, methods and fields that are visible to the JVM. This graph can be queried in a wide range of ways.
  • ClassGraph reads the classfile bytecode format directly, so it can read all information about classes without loading or initializing them.
  • ClassGraph is fully compatible with the new JPMS module system (Project Jigsaw / JDK 9+), i.e. it can scan both the traditional classpath and the visible Java modules. However, the code is also fully backwards compatible with JDK 7 and JDK 8 (i.e. it is compiled to be callable from a JDK 7 project).
  • ClassGraph scans the classpath or module path using carefully optimized multithreaded code for the shortest possible scan times, and it runs as close as possible to I/O bandwidth limits, even on a fast SSD.
  • ClassGraph handles more classpath specification mechanisms found in the wild than any other classpath scanner, making code that depends upon ClassGraph maximally portable.
  • ClassGraph can scan the classpath and module path either at runtime or at build time (e.g. to implement annotation processing for Android).
  • ClassGraph can create GraphViz visualizations of the class graph structure, which can help with code understanding: (click to enlarge | see graph legend here)

Class graph visualization

Documentation

See the wiki for complete documentation and usage information.

See the code examples page for examples of how to use the ClassGraph API.

Status

FastClasspathScanner was renamed to ClassGraph, and released as version 4.

ClassGraph has a completely revamped API. See the porting notes for information on porting from the older FastClasspathScanner version 3 API.

In particular, the Maven group id has changed from io.github.lukehutch.fast-classpath-scanner to io.github.classgraph in version 4. Please see the new Maven dependency rule and module "requires" line in the Wiki documentation.

Mailing List

  • Feel free to subscribe to the ClassGraph-Users email list for updates, or to ask questions.
  • There is also a Gitter room for discussion of ClassGraph.

Author

ClassGraph was written by Luke Hutchison, with contributions from a number of other people:

Please donate if this library makes your life easier:

Alternatives

Some other classpath scanning mechanisms include:

License

The MIT License (MIT)

Copyright (c) 2018 Luke Hutchison

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.