Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. Reflections

Reflections

WTFPLJava0.10.2

A Java library for scanning and indexing classpath metadata to enable runtime type system queries.

GitHubGitHub
4.8k stars705 forks0 contributors

What is Reflections?

Reflections is a Java library that scans and indexes a project's classpath metadata at runtime, enabling reverse transitive queries on the type system. It solves the problem of manually writing reflection code to discover subtypes, annotated types, methods, and resources, providing a streamlined API for metadata analysis.

Target Audience

Java developers building frameworks, tools, or applications that require runtime introspection, such as dependency injection containers, annotation processors, or plugin systems.

Value Proposition

Developers choose Reflections for its functional, composable query API, extensive scanner support, and ability to persist metadata for build-time integration, reducing boilerplate reflection code.

Overview

Java runtime metadata analysis

Use Cases

Best For

  • Discovering all subtypes of an interface or class at runtime
  • Finding all classes or methods annotated with a specific annotation
  • Building dependency injection or plugin systems that require classpath scanning
  • Generating code or resources based on runtime metadata
  • Analyzing method signatures, return types, or parameters across a codebase
  • Integrating metadata indexing into build lifecycle for performance optimization

Not Ideal For

  • Applications using Java 9+ modules that require strict encapsulation and controlled classpath access
  • Performance-critical systems where runtime scanning overhead impacts startup time or memory usage
  • Projects needing active library maintenance with regular updates for Java version compatibility
  • Simple annotation processing tasks better handled by compile-time processors like Annotation Processing Tool (APT)

Pros & Cons

Pros

Functional Query API

Provides a fluent, composable interface for metadata queries, as demonstrated with filter(), map(), and flatMap() operations in the README examples, reducing reflection boilerplate.

Extensive Scanner Support

Includes multiple scanners for types, methods, fields, and resources, allowing detailed indexing and querying, such as MethodsAnnotated or ConstructorsSignature scanners.

Metadata Persistence Options

Supports saving scanned metadata to XML/JSON or generating Java source code, enabling build-time integration for faster runtime performance, as mentioned in the 'Integrating with build lifecycle' section.

Backward Compatibility

Maintains support for older 0.9.x APIs alongside the new functional API, easing migration for existing users despite breaking changes in 0.10+.

Cons

Lack of Active Maintenance

The library is not under active development, with the last release in October 2021, meaning bugs, security issues, or compatibility with newer Java versions may not be addressed.

Complex Configuration Required

Setting up scanners and filters, such as using ConfigurationBuilder and FilterBuilder, can be error-prone and requires careful tuning to avoid scanning unnecessary classes.

Runtime Performance Overhead

Scanning the entire classpath at runtime can slow down application startup, especially for large projects, and the README warns about configuring URLs and filters to mitigate this.

Breaking API Changes

The transition from 0.9.x to 0.10.x introduced breaking changes, requiring code updates, as highlighted in the README's comparison table and notes on deprecated APIs.

Frequently Asked Questions

Quick Stats

Stars4,774
Forks705
Contributors0
Open Issues117
Last commit1 year ago
CreatedSince 2013

Tags

#type-system#annotation-processing#java#reflection

Built With

J
Javassist
J
Java

Included in

Java47.5k
Auto-fetched 1 day ago

Related Projects

ClassGraphClassGraph

An uber-fast parallelized Java classpath scanner and module scanner.

Stars2,976
Forks302
Last commit6 months ago
jOORjOOR

jOOR - Fluent Reflection in Java jOOR is a very simple fluent API that gives access to your Java Class structures in a more intuitive way. The JDK's reflection APIs are hard and verbose to use. Other languages have much simpler constructs to access type meta information at runtime. Let us make Java reflection better.

Stars2,834
Forks376
Last commit1 year ago
ReflectASMReflectASM

High performance Java reflection

Stars1,546
Forks219
Last commit10 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub