plugin - plugin for a large enterprise application that is based on Swing

ui - additional UI components in JavaFX, does only use the core data classes

Now we want to implement drag-and-drop transfers between the UI in JavaFX and the plugin in Swing. Thanks to a question on StackOverflow, there are no more technical issues in the implementation.

However, I do not know where to put the meta information on how the data structures should be transfered through the operating system. For Swing, I need to define (or reuse) a DataFlavor, in JavaFX a DataFormat is required. Both of these classes are based on a simple string that should / must contain a MIME type, e.g. text/plain or application/x-some-custom-data. But where should this kind of information be defined?

Idea: Store the DataFormat / DataFlavor directly in the class that uses it, e.g. a controller:

Idea 3 does not require annotations. Just create a public constant and use it in a thin UI wrapper.
– BasilevsAug 23 '18 at 3:46

Of course, that would be possible and would eliminate the disadvantage. However, I would consider this kind of information meta data and this is what annotations are for. Also, this would provide me some consistent way to access the information, using a constant I would need to follow some convention, because Java does not allow some kind of contract (interface, inheritance) for static methods and fields.
– Lukas KörferAug 24 '18 at 9:49