Is there a possibility to include file metadata fields to the anchor's markup in RTF?

On our custom Rich Text Field class, we want to access image and file metadata fields to extend functionalities for those anchor fields.

When the editors add an anchor to this file to an RTF field, we would like to extend this functionality and provide custom HTML Markup based on that metadata field.

We're using SDL Web 8.5, and Java DXA 1.7

Currently this is the information we have on the RTF's souce:

    <a href="tcm:7-417850" title="AGA Offshore Manifold datasheet.pdf">PDF 1</a>

Once it reaches to our custom RichTextField class we also have file information, such as xlin:href, data-schemauri, data-multimediafilename, etc.

And need the metadata fields included to the anchor attributes