I know Java does not have pre-processor, but I struggle to find a way to do this.
I am looking to create macros to improve code readibility, to specify which of the functions or parameters are for input or output specifically. In C, this would be done like this :
#define IN
#define OUT
And these would just be used before the variables and functions. Can I simulate the same behavior in Java?
I did not manage to find a way to do this. The only way I found was including defines in the code and first using the cpp pre-processor to replace them, and then run the java code, but maybe there is a better way of doing this?
@Inputand@Output, which you'd define yourself via apublic @interface. My understanding is you want these merely as markers in the source code, which the annotations would allow some auto-complete. However, you might be served just as well by a comment or structuring your design in a way that inputs/outputs are distinct in some fashion