[forge-issues] [JBoss JIRA] (ROASTER-63) JavaClassSource - Cannot extend another class when using the fluent builder

Claus Ibsen (JIRA) issues at jboss.org
Tue Feb 17 06:34:48 EST 2015


Claus Ibsen created ROASTER-63:
----------------------------------

             Summary: 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)


More information about the forge-issues mailing list