[
https://issues.jboss.org/browse/ROASTER-63?page=com.atlassian.jira.plugin...
]
Nicolas Challut commented on ROASTER-63:
----------------------------------------
Okay, the doc isn't perfect but I think that you could find this one ;)
{code}
JavaClassSource source = Roaster.create(JavaClassSource.class);
source.setName("Bar");
source.setSuperType("org.apache.camel.builder.RouteBuilder");
{code}
JavaClassSource - Cannot extend another class when using the fluent
builder
---------------------------------------------------------------------------
Key: ROASTER-63
URL:
https://issues.jboss.org/browse/ROASTER-63
Project: Roaster
Issue Type: Enhancement
Reporter: Claus Ibsen
I need to create a java class that extends another. As there is no .addExtends or
.extends or something I had to work around and use the parse.
I can only find an .addInterface
Here is the code I use with my workaround
{code}
// need to parse to be able to extends another class
String top = String.format("public class %s extends RouteBuilder {}",
name.getValue());
final JavaClassSource javaClass = Roaster.parse(JavaClassSource.class, top);
if (targetPackage.getValue() != null) {
javaClass.setPackage(targetPackage.getValue());
}
{code}
eg what I want to do is
{code}
javaClass.extends("RouteBuilder");
{code}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)