Can you create loops in code templates, for example, I want to print all the fields in a class. Is there a template for this?
Since I did not find what I was looking for, I put it in the plugin . It supports options. If you have classa name Companywith fields companyName, companyTypeetc., It will generate print statements, as shown below, if you choose the logger.debug option:
class
Company
companyName
companyType
if (logger.isDebugEnabled()) { logger.debug("Company Name " + company.getCompanyName()); logger.debug("Company Type " + company.getCompanyType()); }
Assuming you're talking about Java > Editor > Templates, the link (may be out of date) here
Java > Editor > Templates
SO useful-eclipse-java-code-templates .
toString(), : toString() :
Eclipse can generate toString(), which includes a listing of all fields and their string values, if that is what you are after.
toString()