[JBoss JIRA] (FORGE-1750) Create command to generate getters and setters for a given Java source file using the builder pattern
by Matej Briskar (JIRA)
[ https://issues.jboss.org/browse/FORGE-1750?page=com.atlassian.jira.plugin... ]
Matej Briskar edited comment on FORGE-1750 at 4/29/14 11:08 AM:
----------------------------------------------------------------
>From now on it looks probably like this then:
1) Connect with the FORGE-1749, use a flag --builder.
2) If some other getters/setter were created before the command and they do not follow the selected builder/non-builder way, ask using prompt if they should be removed or added
3) For builder methods, use "with..." method naming
4) No constructor manipulation, nor adding the static newInstance method.
was (Author: mbriskar):
From now on it looks probably like this then:
1) Connect with the FORGE-1749, use a flag --builder.
2) If some other getters/setter were created before the command and they do not follow the selected builder/non-builder way, ask using prompt if they should be removed or added
3) For builder methods, use "with..." method naming
> Create command to generate getters and setters for a given Java source file using the builder pattern
> -----------------------------------------------------------------------------------------------------
>
> Key: FORGE-1750
> URL: https://issues.jboss.org/browse/FORGE-1750
> Project: Forge
> Issue Type: Feature Request
> Components: Builtin Plugins, Java EE
> Affects Versions: 2.4.1.Final
> Reporter: Lincoln Baxter III
> Assignee: Matej Briskar
> Labels: starter
> Fix For: 2.x Future
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (FORGE-1750) Create command to generate getters and setters for a given Java source file using the builder pattern
by Matej Briskar (JIRA)
[ https://issues.jboss.org/browse/FORGE-1750?page=com.atlassian.jira.plugin... ]
Matej Briskar edited comment on FORGE-1750 at 4/29/14 11:09 AM:
----------------------------------------------------------------
>From now on it looks probably like this then:
1) Connect with the FORGE-1749, use a flag --builder.
2) If some other getters/setter were created before the command and they do not follow the selected builder/non-builder way, ask using prompt if they should be removed or ignored
3) For builder methods, use "with..." method naming
4) No constructor manipulation, nor adding the static newInstance method.
was (Author: mbriskar):
From now on it looks probably like this then:
1) Connect with the FORGE-1749, use a flag --builder.
2) If some other getters/setter were created before the command and they do not follow the selected builder/non-builder way, ask using prompt if they should be removed or added
3) For builder methods, use "with..." method naming
4) No constructor manipulation, nor adding the static newInstance method.
> Create command to generate getters and setters for a given Java source file using the builder pattern
> -----------------------------------------------------------------------------------------------------
>
> Key: FORGE-1750
> URL: https://issues.jboss.org/browse/FORGE-1750
> Project: Forge
> Issue Type: Feature Request
> Components: Builtin Plugins, Java EE
> Affects Versions: 2.4.1.Final
> Reporter: Lincoln Baxter III
> Assignee: Matej Briskar
> Labels: starter
> Fix For: 2.x Future
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (ROASTER-5) Having method parameters a bit more typed
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/ROASTER-5?page=com.atlassian.jira.plugin.... ]
Lincoln Baxter III commented on ROASTER-5:
------------------------------------------
No, but there should be a getOrigin() or getParent() method added to these APIs so that we can support:
{code}
method.addParameter().getParent().addParameter()
{code}
> Having method parameters a bit more typed
> -----------------------------------------
>
> Key: ROASTER-5
> URL: https://issues.jboss.org/browse/ROASTER-5
> Project: Roaster
> Issue Type: Feature Request
> Components: API
> Affects Versions: 2.1.0.Final
> Reporter: Antonio Goncalves
> Assignee: George Gastaldi
> Fix For: 2.2.0.Final
>
>
> I want to create a Bean Validation implementation, that means that the {{isValid}} method takes two parameters. And the only way to add two parameters seems to be by a String
> {code}
> javaClass.addMethod().setPublic().setName("isValid").setReturnType("boolean").setParameters("Number value, ConstraintValidatorContext context").setBody("return false;").addAnnotation(Override.class);
> {code}
> It would be nice to have typed parameters so the import is implicit, and things are a bit more typed :
> {code}
> javaClass.addMethod().setPublic().setName("isValid").setReturnType("boolean").addParameter(Number.class, "value").addParameter(ConstraintValidatorContext.class, "context").setBody("return false;").addAnnotation(Override.class);
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (ROASTER-10) Auto generated imports when a field type is set causes .java file to not compile.
by Walter Medvedeo (JIRA)
[ https://issues.jboss.org/browse/ROASTER-10?page=com.atlassian.jira.plugin... ]
Walter Medvedeo commented on ROASTER-10:
----------------------------------------
I agree that to overload the method adding the boolean on/off version is not elegant.
But I believe it gives the opportunity to have more control over whats happening with the class, and this can be useful in some scenarios.
> Auto generated imports when a field type is set causes .java file to not compile.
> ---------------------------------------------------------------------------------
>
> Key: ROASTER-10
> URL: https://issues.jboss.org/browse/ROASTER-10
> Project: Roaster
> Issue Type: Bug
> Components: API
> Affects Versions: 2.2.0.Final
> Reporter: Walter Medvedeo
>
> When we set the Type for a given field using the FieldSource.setType( X ) methods an import is generated automatically.
> Under some situations it causes the resulting class to not compile and it's not posible to fix it using the api.
> In order to avoid this, and also to be able to modify a given class in a more "safe or controlled" way (for example in cases when we don't want to manage complex refactorings or controlling imports), It's desirable to have setType( X, boolean addImports) method that just change the field type to the provided type name and don't add imports.
> e.g:
> Given the following declaration:
> private org.test.Class1 myField;
> myField.setType("org.somepackage.Class2", false)
> will produce the following result:
> private org.somepackage.Class2 myField;
> and:
> myField.setType("Class2", false)
> will produce the following result:
> private Class2 myField.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (FORGE-1750) Create command to generate getters and setters for a given Java source file using the builder pattern
by Matej Briskar (JIRA)
[ https://issues.jboss.org/browse/FORGE-1750?page=com.atlassian.jira.plugin... ]
Matej Briskar edited comment on FORGE-1750 at 4/28/14 6:00 PM:
---------------------------------------------------------------
1. What about creating one command for both FORGE-1749, FORGE-1750 prompting the user while executing to choose one?
2. What builder pattern application to choose? setName vs withName, new Person() vs Person.newInstance()?
was (Author: mbriskar):
1. What about creating one command for both FORGE-1749, FORGE-1750 prompting the user when executing to choose one?
2. What builder pattern application to choose? setName vs withName, new Person() vs Person.newInstance()?
> Create command to generate getters and setters for a given Java source file using the builder pattern
> -----------------------------------------------------------------------------------------------------
>
> Key: FORGE-1750
> URL: https://issues.jboss.org/browse/FORGE-1750
> Project: Forge
> Issue Type: Feature Request
> Components: Builtin Plugins, Java EE
> Affects Versions: 2.4.1.Final
> Reporter: Lincoln Baxter III
> Assignee: Matej Briskar
> Labels: starter
> Fix For: 2.x Future
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months