inheritance - Letting a single Java annotation implicitly set multiple annotations -


i have written java library defines , uses custom annotation find methods called via reflection.

see this example

@yauaafield("deviceclass") public void setdeviceclass(testrecord record, string value) {     record.deviceclass = value; } 

so ides intellij , other code analysis tools report of functions annotated way "unused".

what automated way has been annotated @yauaafield automatically annotated @suppresswarnings("unused").

i've done quite bit of googling, read through several online manuals, tutorials , java documentation. yet have not yet been able find how that. annotations not seem support 'inheritance' of kind.

so want possible?

if not other options have?

so far have found these 2 ways suppress these needless warnings:

  • in intellij found manual option suppress warning on methods annotated yauaafield. manual option.
  • manually set @supresswarnings("unused") on of methods/classes.

is there better way?

not entirely automated, nice workaround. in intellij can set own live template suggest autocomplete when typing annotation:

enter image description here


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -