This project is part of the Hexlet Java OOP course.
It demonstrates the use of Java’s Reflection API, annotations, and runtime class inspection to build flexible and introspective systems.
The goal of this assignment is to show how your code can analyze and modify itself at runtime, and how annotations and reflection can be used to build dynamic tools and frameworks.
Key learning outcomes:
- Using the Reflection API to inspect classes, methods, fields, and constructors
- Defining and processing custom annotations
- Building utilities that work with unknown classes at runtime
- Applying reflective techniques to validate, instantiate, or serialize objects
In this project you’ll find:
- Custom annotation(s) (e.g.,
@MyAnnotation,@Validate) – used to mark classes/methods/fields for reflective processing - Reflection utilities (e.g.,
ClassInspector,AnnotationProcessor) – that scan for annotated elements and perform actions at runtime - Example usage under
examples/showing how reflective patterns can replace hard-coded logic
To verify correctness locally:
./gradlew clean testExpected result:
BUILD SUCCESSFUL
.
├── build.gradle
├── settings.gradle
├── Makefile
├── README.md
├── src
│ ├── main/java/exercise/
│ │ ├── (Your annotation classes)
│ │ ├── (Your reflection-helper classes)
│ └── test/java/exercise/
│ └── (Your JUnit tests for reflective functionality)
└── examples/
└── (Demonstration classes using reflection)
- Java 21
- Gradle
- JUnit 5
- Ubuntu / cross-platform compatible
Vasyl Polyak
📍 Pittsburgh, PA
GitHub: VasylP0
Hexlet Java OOP Track
Project: java-oop-ru/reflections