Skip to content

Aseeef/JavaAseefianReflections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Download Jitpack Contributors Forks Stargazers Issues MIT License LinkedIn


Aseefian Aseefian Reflections [JAR]

A Comprehensive Reflections Library for Java
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact

About The Project

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.

Features

  • 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.

(back to top)

Getting Started

Prerequisites

JAR requires at least Java 11 or higher.

Installation

JAR may be installed either via the Jitpack maven repository or downloaded directly and then added as a dependency.

Gradle

repositories {
	...
	maven { url 'https://jitpack.io' }
}
dependencies {
    implementation ('com.github.Aseeef:JavaAseefianReflections:latest.release')
}

Maven

<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>

(back to top)

Example Usage

    // 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

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Muhammad Aseef Imran - [email protected]

Project Link: https://github.com/Aseeef/JavaAseefianReflections

(back to top)