[forge-issues] [JBoss JIRA] (ROASTER-41) Being able to add constructors
George Gastaldi (JIRA)
issues at jboss.org
Mon Oct 27 11:00:43 EDT 2014
[ https://issues.jboss.org/browse/ROASTER-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Gastaldi closed ROASTER-41.
----------------------------------
> Being able to add constructors
> ------------------------------
>
> Key: ROASTER-41
> URL: https://issues.jboss.org/browse/ROASTER-41
> Project: Roaster
> Issue Type: Feature Request
> Components: API
> Affects Versions: 2.8.2.Final
> Reporter: Antonio Goncalves
> Fix For: 2.x Future
>
>
> At the moment there is no easy way to add a constructor. {{JavaClassSource}} has an API to add methods, fields, annotation... but no constructor. The closest to create a constructor would be :
> {code}
> javaClassSource.setName("MyException").setSuperType(Exception.class);
> javaClassSource.addMethod().setPublic().setName("MyException").setBody("super();");
> {code}
> The method returns void and setting the name of the method is useless. It would be better to have something like :
> {code}
> javaClassSource.setName("MyException").setSuperType(Exception.class);
> javaClassSource.addConstructor().setPublic().setBody("super();");
> javaClassSource.addConstructor().setPublic().setParameters("String message").setBody("super(message);");
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the forge-issues
mailing list