Women in Technology

Hear us Roar



Article:
  Custom PMD Rules
Subject:   Rule to search for a particular word in a java file.
Date:   2005-06-22 08:28:44
From:   Aarts
Hi friends,
Gud Day to u all.
Can I have the XPATH code,to be used in PMD, to search for a particular word in a java file, even if it is commented, or inside a loop statement ,etc.
Full Threads Newest First

Showing messages 1 through 4 of 4.

  • Rule to search for a particular word in a java file.
    2005-06-22 15:23:26  tcopeland [View]

    Hi Aarts -

    Hm, I'm not sure if PMD will be the best tool for you in this regard, since it discards comments.

    However, perhaps the Unix utility "grep" would work for you... it can search files with regular expressions, report the surrounding context for each occurrence, and so forth.

    Yours,

    Tom
    • Rule to search for a particular word in a java file.
      2005-07-05 06:00:05  Aarts [View]

      Hi Tom,
      Thanks for responding.

      I guess ASTName searches every word in the code.So using that i was able to get my issue resolved.
      So I just thought of sharing it with u.
      Thanks again.
      • Rule to search for a particular word in a java file.
        2005-07-05 06:07:22  tcopeland [View]

        Super, thanks!

        Tom
      • Rule to search for a particular word in a java file.
        2006-03-21 23:13:41  PravinD [View]

        can you please say, how to search for a particular String pattern (not a word) in the java code?