I'm building a SDK which will be distributed without source via JAR. Everything works, but the descriptive argument names I use in my interface classes are lost in the process.
My interface:
package com.example;
public interface ExampleInterfaceClass {
/**
* Method documentation
* @param descriptiveParameter a parameter name I want included for anyone implementing this interface from a JAR
*/
public void DoSomething(int descriptiveParameter);
}
When I implement this interface with source available, the 'descriptiveParameter' auto-generates properly as 'descriptiveParameter':
public class ExampleImplementor implements ExampleInterfaceClass {
@Override
public void DoSomething(int descriptiveParameter) {
// TODO Auto-generated method stub
}
}
However, when I implement from a compiled JAR, the parameter auto-generates as "arg0":
public class ExampleImplementFromJAR implements ExampleInterfaceClass {
@Override
public void DoSomething(int arg0) {
// TODO Auto-generated method stub
}
}
A number of solutions have been proposed via questions like this one: Preserving parameter/argument names in compiled java classes, but none hit on a solution that enables me to 1. Include descriptive parameters in my JAR, and 2. Hide source from other classes. Is there a way to include source from only my interface files in a JAR file via eclipse export? If not, what is the next easiest way to produce a JAR with a subset of source objects?