reflect is a Java library whose purpose is unfettering, condensing and streamlining reflection by providing for most common reflective operations (and more) powerful methods that don't obey access limitations or declare checked exceptions (unlike every standard reflective method ever).
See the actions for Java distribution support information.
dependencies {
implementation("net.auoeke:reflect:6.+")
}
Accessor
reads, mutates and copies fields.Classes
loads and deals with classes. It can also change object types likereinterpret_cast
in C++.ClassDefiner
defines classes.ConstantPool
is a proxy for the JDK's internalConstantPool
that reads constant pools.Constructors
finds constructors and instantiates classes.EnumConstructor
adds enumeration constants with safety handling.Fields
enumerates class fields directly and withoutField
copying, security checks and filters.Flags
provides utilities for dealing with flags (including particularly Java flags).Invoker
is a static proxy forIMPL_LOOKUP
(which has unrestricted privileges) and contains other method handle utilities.JavaLangAccess
provides partial access to the JDK'sJavaLangAccess
.Methods
enumerates and finds class methods.Modules
gets and opens modules.Pointer
is a (primarily) field reference that is similar toField
but without access restrictions and for use with frequently accessed fields.Reflect
providesInstrumentation
access.StackFrames
assists in getting stack frames and callers and supportsStackWalker
and the traditionalStackTraceElement[]
.Types
deals withClass
es in many ways including type conversion.
Use uncheck for IntelliJ IDEA in order to suppress checked exception warnings.
Relevant tests are in the main test classes; everything else is irrelevant.