| Summary: | [templates] Add Java editor template variables to iterate over class fields | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | JW <jw2online> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | ASSIGNED --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P5 | CC: | daniel_megert, juergen, Olivier_Thomann, vuk |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Move to JDT/UI *** Bug 436580 has been marked as a duplicate of this bug. *** This would be very useful for filling DTOs.
Syntax could be s.th. along
${field-foreach} public void myFancySetter(${field-type} ${field-name}) .....
|
Build Identifier: 20100917-0705 If this exists, I would welcome a pointer to some clear documentation. I will describe my need in the hopes that will clarify what I am looking for. I need to perform repeat operations on all fields of the class I'm in. For example: public void printAll() { int count = 0; System.out.println("Variable " + pos++ + ":" + ${field variable here}); ... etc. } Note that this is a simple example. I am aware of the automatic "toString()" functionality, but that is not what I'm after. I used this example for simplicity. This would also be useful in writing a different custom equals than what Eclipse provides. Reproducible: Always