Hello,
We're trying to create the following method:
public <T> List<T> apiGet(String url, Class<T> clazz)
but am unable to generate the first "" marker. Is this possible?
Here's the code I'm using:
public static void main(final String[] args) {
final JavaClassSource javaClass = Roaster.create(JavaClassSource.class);
javaClass.setName("TestClass");
final MethodSource<?> methodSource = javaClass.addMethod();
methodSource.setName("apiGet").setPublic().setBody("return null;");
methodSource.addParameter("String", "url");
methodSource.addParameter("Class<T>", "clazz");
methodSource.setReturnType("List<T>");
//methodSource.setReturnType("<T> List<T>"); // does not work: throws StringIndexOutOfBoundsException
log.info("\n\n" + javaClass.toString() + "\n");
}
Thanks for any help you can offer!