The JavaFX language offers a Reflection API to let developers inspect the members of loaded classes at runtime. You may be familiar with similar functionalities available in other languages such as Java. In JavaFX the Reflection API which let you discover members such as function and variable types attached to a class definition. The Reflection API is housed in the javafx.reflect package and provide several classes needed to introspect loaded classes including FXLocal, FXContext, and ClassType. The following shows how the API works by creating a JavaFX application that lists the declared variables and functions on a given class.
Reflecting on Classes
Before you dive into the code, this is how the reflection API works:
The following application uses the reflection API to display introspective information about a class:
When you run the application locally, you can get access to class information as shown in the figure below: