Announcement Announcement Module
Collapse
No announcement yet.
Advising all *BUT* setter/getters? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advising all *BUT* setter/getters?

    New at this, but have been looking at the docs for the RegexMethodPointcutAdvisor. Is there a reasonable way to use this to advise all methods EXCEPT setter/getters?

  • #2
    I believe it's possible to define a regexp that explicitly forbids certain patterns. Can't remember the syntax off the top of my head--might want to check the docs around the J2SE regexp support, for which regexp flavour it supports.

    Comment


    • #3
      For Java-Regexps you might try this one:
      Code:
      ^(?:(?:[gs]e[^t])|(?:[gs][^e])|(?:[^gs])).*$
      It matches everything which does not start with "get" or "set". For fully qualified names you might have to alter it a little bit.

      Regards,
      Andreas

      Comment

      Working...
      X