need condition to identify class or package of match/fix

Issue #20 new
Ernie Rael
created an issue

(this was discussed in issue 16, but that issue's about something else)

Conditions like {{{ inClass("org.x.y.Z") inPackage("org.x.y") }}} are needed in many cases (maybe isFile() as well?).

And a way for specifying a regex pattern would be nice.

Comments (3)

  1. Jan Lahoda repo owner

    Thanks for reporting this separately. I have added new conditions "inClass"/"inPackage" and "enclosingClasses"/"enclosingPackage" methods to Context. Originally, I was also thinking about allowing some patterns (more like glob patterns, probably), but I realized that I do not know strong usecase for such patterns. So, for now, the names are matched exactly (but any enclosing class will match and there may be more than one FQN), and the patterns can be added once there is a clear usecase.

    in trunk: in release701:

  2. Ernie Rael reporter

    I added these to the supplementary doc in wiki.

    Question: for "inClass", if I want to specify an inner class only (but not the outer class), do I use '$'? As in$Inner

    BTW, I couldn't really see a need for the pattern capability (other than it would be cool) ;-)

  3. Log in to comment