How to get field values with Reflection and with direct memory access in Java

Burningwave
1 min readNov 21, 2020

--

To get field values from an object in Java we are going to use Fields component of Burningwave Core, a fully independent, advanced, free and open source Java frameworks building library that is useful for scanning class paths, generating classes at runtime, facilitating the use of reflection, scanning the filesystem, executing stringified source code and much more…

To use Burningwave Core you should simply add the following to your projects dependencies:

Fields component uses to cache all fields for faster access and in this code snippet we show how to handle the fields of any Java object even of anonymous type:

In this short article we have learned how to get fields of Java objects and how to handle them; the complete source is available at this link and for more articles about Burningwave Core you can go to the main page.

--

--

Burningwave

A collection of Java libraries for building frameworks and applications: https://www.burningwave.org