Hello Rado,
Regarding the output parameter, the only way to do it is using a parameter having its name “targetProductFile”.
This is a default parameter:
Also, in ToolAdapterConstants you can see a constant with this value, which is after used in finding the output parameter (by its name).
As for the second question, from the code that I see inside ParameterDescriptorFactory (lines 195-208), it should detect the bands of the first source product and fill the value set for that parameter with the list of bands. You can try it with org.esa.snap.core.datamodel.Band.class (I see it used like this in the annotated operators)
Best regards,
Oana