Annotations in ABAP!
This project is a technology study / proof of concept of implementing a framework to manage class based annotations in ABAP. Since there is no native language support for annotations the assignments are done in customizing tables. The current state is still very much unfinished and not production ready. I am currently not planning on finishing this project (the necessary efforts and drawbacks are way too high). Feel free to fork it or take parts of it for reference.
DO NOT USE IN PRODUCTION.
DATA: lo_annotation TYPE REF TO zcl_my_annotation.
DATA(lo_annotated_class) = NEW zcl_annotated_class( ).
DATA(lo_processor) = zcl_aap_proc_object=>from_object( lo_annotated_class ).
IF lo_processor->is_annotation_present_by_data( lo_annotation ).
lo_annotation ?= lo_processor->get_annotation_by_data( lo_annotation ).
WRITE lo_annotation->mv_my_attribute.
ENDIF.