A Comprehensive Reflections Library for Java
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
J.A.R. is a easy to use, convenient, fast, and battle tested Java Reflections library originally developed for use with in the Minecraft Plugin development scene. J.A.R. aims to make working with Java reflections much easier and straightforward removing much of the boilerplating traditionally needed for vanilla reflections. The library interface is designed to be as intuitive as possible.
- Ability to search methods and fields by their types.
- Support for variable length arguments and primitive to boxed conversions.
- Uses cacheing for fast performance (optionally using Ben Manes Caffeine library).
- Battle-tested on production systems with added unit testing for addition confidence of correctness.
- Well-documented library API.
- Thread-safe.
- Written 100% in pure java with no additional libraries requirements.
JAR requires at least Java 11 or higher.
JAR may be installed either via the Jitpack maven repository or downloaded directly and then added as a dependency.
repositories {
...
maven { url 'https://jitpack.io' }
}
dependencies {
implementation ('com.github.Aseeef:JavaAseefianReflections:latest.release')
}
<repositories>
...
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Aseeef</groupId>
<artifactId>JavaAseefianReflections</artifactId>
<version>LATEST</version>
</dependency>
// configure the JarConfig
JARConfig config = new JARConfig();
config.setAllowAccessingInheritedMethods(true);
config.setAllowAccessingInheritedFields(true);
// or leave the config parameter blank for the default config (which will work for most people)
JavaAseefianReflections jar = JavaAseefianReflections.init(config);
// Reflectively invoke some method - has a very natural taste almost like calling a method non-reflectively
jar.invokeMethod(obj, "doSomething", param1, param2, param3)
For more examples, please refer to the Documentation
Distributed under the MIT License. See LICENSE.txt
for more information.
Muhammad Aseef Imran - [email protected]
Project Link: https://github.com/Aseeef/JavaAseefianReflections