Generate setters that return self in Eclipse
问题 I'd like to have my setters so that I can chain them like: myPojo.setX(x).setY(y); Usually I generate setters with Eclipse but unfortunately code template for setters allows me to change only the body of the setter, not the signature. What would be the easiest way to complete the above? Besides search-and-replace + manual editing? :) 回答1: You could use the Editor/Templates for this purpose. To define a new Template open the Preferences Window, then Java->Editor->Templates. In this window you