Due to changes in a library I'm using, the getters were replaced with direct access to the property. Eg:
public class MyLibraryClass {
private String field;
public String getField() { return field; }
}
has become
public class MyLibraryClass {
public String field;
}
Consequently I'd want to use IntelliJ's SSR to replace the getter calls with the Bean property. However I've gotten stuck on how to use regexp capture groups for my replacement. If there's another IntelliJ shortcut to do what I want, I'm happy to use it.
The following SSR search parameters find the getters, but I can't seem to be able to use the capture group for $property$
in the replacement. I've tried \1
and \$1
and $1
see (using backreferences in IntelliJ)
I also tried changing the search to $instance$.get$property$()
(clearing the constraints for $property$
but the search didn't return any results.
- How can I access the capture group (
$1
) - Is it possible to perform any processing on
$1
before substitution (to fix the case)
I noticed the Script text
option which accepts Groovy code, however I couldn't find any documentation on this feature.