Custom Code Generation With Global Variables [message #1849740] |
Mon, 31 January 2022 14:38  |
Eclipse User |
|
|
|
Hi Everyone,
I am wondering if there is a way to generate code similarly to how the getters and setters can automatically be generated off global variables.
In my system, I have a set of read and write functions that are needed frequently for a variety of variables and it can be quite time-consuming to implement each line. For example:
//Global Variables
protected String strA;
protected double doubA;
protected int intA;
...
//Methods
protected void write(BinaryWriter out)
{
out.writeStr(strA);
out.writeDoub(doubA);
out.writeInt(intA);
}
Is there any way that I can implement this write method automatically using the global variables? I have looked into code templates a bit but I can't seem to find what I am looking for exactly. Is this even a possibility? Or can someone point me in another direction?
Thanks for any and all feedback.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02818 seconds