Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to look for annotations in eclipse java search

I would like to find all annotations used in project (annotatons that are assigned to type, field or method). I have hoped that java search would help me with it, but I was not able to make that work.

P.S. I cannot just search for @, because its also used in javadocs.

P.S. 2. I do not know all annotations that are used in project, so I cannot search for it by name.

like image 591
IAdapter Avatar asked Nov 22 '11 10:11

IAdapter


1 Answers

Try: CTRL-H -> File Search, check Case Sensitive and Regular expression, and input:

  • @[A-Z] for Containing text
  • *.java for File name patterns
  • maybe restrict scope to selected resources (and select your project before)

This way you'll find all the occurences of type "@ followed by any uppercase character". Normally this should leave out the javadocs and leave you with actual annotation occurances.

like image 128
Shivan Dragon Avatar answered Oct 14 '22 06:10

Shivan Dragon