<div dir="ltr">Hey Antonio,<div><br></div><div>Sorry for the late reply.</div><div>Some of the functionality you ask for is missing, but some of it is there. I believe we have a property API which will allow you to getAccessor/Mutator, and also the Refactory should provide the functions for generating getters/setters. The annotation stuff I think is a gap.</div>
<div><br></div><div>Gotta keep it brief, but I hope that helps. Feel free to add JIRA issues to ROASTER for the missing stuff and we&#39;ll try to get it done!</div><div>~Lincoln<br><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, May 26, 2014 at 9:35 AM, Antonio Goncalves <span dir="ltr">&lt;<a href="mailto:antonio.mailing@gmail.com" target="_blank">antonio.mailing@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I&#39;m trying to use Roster 2.4.0.Final to manipulate generated Java code at one of my customers. There are features that I miss, and I don&#39;t know if it&#39;s because it&#39;s missing, or I don&#39;t know how to do it :</div>


<div><br></div><div>* Remove an attribute in an annotation. Let&#39;s say I have @Table(name = &quot;myTable&quot;, schema = &quot;mySchema&quot;), I want to be able to remove the schema attribute and end up with @Table(name = &quot;myTable&quot;)</div>


<div>* Change the value of an attribute in an annotation. Let&#39;s say I have @OneToMany (fetch = LAZY) and I want to change LAZY to EAGER. I know how to get this value (ValuePair.getName() and ValuePair.getStringValue()) but I don&#39;t know how to set a new value (I was expecting something like ValuePair.setStringValue())</div>


<div>* Is there a way to only get the accessors ? At the moment source.getMembers() returns the attributes + getters/setters, source.getFields() only returns the attributes and source.getMethods() returns all the methods. It would be nice to have sources.getAccessors() and that will return only the accesors</div>


<div>* Indent code : the code I have in input is not well indented. I would love to have a method like source.indent()<br></div><div>* Generate Getters/Setters/Hascode/Equals/toString : it would be great to have a set of methods to do the trick. Something like source.generateSetters, source.generateEquals</div>


<div><br></div><div>Let me know if I&#39;m missing somethings here, if some are out of the scope of Roaster and if some make sense and are missing I&#39;ll create a few JIRAs</div><div><br></div><div>Antonio</div></div><div class="gmail_extra">


<br><br><div class="gmail_quote">2014-04-26 6:28 GMT+02:00 Antonio Goncalves <span dir="ltr">&lt;<a href="mailto:antonio.mailing@gmail.com" target="_blank">antonio.mailing@gmail.com</a>&gt;</span>:<div><div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I had created two JIRAs for that :<div><br></div><div><a href="https://issues.jboss.org/browse/ROASTER-4" target="_blank">https://issues.jboss.org/browse/ROASTER-4</a><br></div><div><a href="https://issues.jboss.org/browse/ROASTER-5" target="_blank">https://issues.jboss.org/browse/ROASTER-5</a> (looks like this one is done)<br>



</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-21 21:22 GMT+02:00 Lincoln Baxter, III <span dir="ltr">&lt;<a href="mailto:lincolnbaxter@gmail.com" target="_blank">lincolnbaxter@gmail.com</a>&gt;</span>:<div>


<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Antonio,<div><br></div><div>I&#39;m relatively certain that we don&#39;t support Generic types on method parameters yet, but we do support them on Types and Methods themselves via the GenericCapableSource interface.</div>




<div><br></div><div>Looks like we need to add this to Parameters. Could you add a feature request for this? Thanks!</div><div><br></div><div>~Lincoln </div>







</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Sun, Mar 30, 2014 at 1:05 PM, Antonio Goncalves <span dir="ltr">&lt;<a href="mailto:antonio.mailing@gmail.com" target="_blank">antonio.mailing@gmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi,<div><br></div><div>Still playing with Roaster so I could fix <a href="https://issues.jboss.org/browse/FORGE-1618" target="_blank">https://issues.jboss.org/browse/FORGE-1618</a> (Command constraint-new-validator to create a new validator implementation). I don&#39;t know how to do two things (nicely) :</div>





<div><br></div><div><b># Parameterize interface</b></div><div><br></div><div>For a constraint, I need to implement a parametrize interface like this :</div><div><br></div><div>public class MaxValidatorForString implements <font color="#ff0000">ConstraintValidator&lt;Max, Number&gt;</font> {<br>





</div><div><br></div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;max-height:30em;overflow:auto;white-space:pre-wrap;word-wrap:normal;color:rgb(51,51,51);font-size:12px;line-height:16px;background-color:rgb(245,245,245)">
<span style="background-color:rgb(255,255,255);font-family:arial;font-size:small;line-height:normal;color:rgb(34,34,34)">The only way I could find is passing a String :</span></pre></div><div>







<p><span>final </span>JavaClassSource javaClass = Roaster.<i>create</i>(JavaClassSource.<span>class</span>);<br>
javaClass.setName(<span>&quot;MaxValidatorForString&quot;</span>);<br>
javaClass.addImport(ConstraintValidator.<span>class</span>);<br>
javaClass.addInterface(<span>&quot;<font color="#ff0000">ConstraintValidator&lt;Max, Number&gt;</font>&quot;</span>);<br>
</p></div><div><br></div><div>It&#39;s a shame because with addInterface(Class), it does the import automatically and things are more typed. But I cannot add types :</div><div>







<p><span>final </span>JavaClassSource javaClass = Roaster.<i>create</i>(JavaClassSource.<span>class</span>);<br>
javaClass.setName(<span>&quot;MaxValidatorForString&quot;</span>);<br>
javaClass.addInterface(<font color="#ff0000">ConstraintValidator.<span>class</span></font>);<br>
</p></div><div><br></div><div>It would be good to have something like :</div><div><div class="gmail_extra"><div><p>javaClass.addInterface(ConstraintValidator.<span>class</span>).<font color="#ff0000">addType(Max.class).addType(Number.class)</font>;<br>





</p></div><div><br></div><div><b># Typed parameters</b></div><div><br></div><div>My isValid method takes two parameters. And the only way to add two parameters seems to be by a String</div><div><br></div><div>







<p>javaClass.addMethod().setPublic().setName(<span>&quot;isValid&quot;</span>).setReturnType(<span>&quot;boolean&quot;</span>).setParameters(<span><font color="#ff0000">&quot;Number value, ConstraintValidatorContext context&quot;</font></span>).setBody(<span>&quot;return false;&quot;</span>).addAnnotation(<span>Override</span>.<span>class</span>);<br>






</p></div><div><br></div><div>Again, it would be nice to have typed parameters so the import is implicit, and things are a bit more typed :</div><div><br></div><div><div><p>javaClass.addMethod().setPublic().setName(<span>&quot;isValid&quot;</span>).setReturnType(<span>&quot;boolean&quot;</span>).<font color="#ff0000">addParameter(<span>Number.class, &quot;value&quot;).addParameter(ConstraintValidatorContext.class, &quot;context&quot;</span>)</font>.setBody(<span>&quot;return false;&quot;</span>).addAnnotation(<span>Override</span>.<span>class</span>);<br>





</p></div></div><div><br></div><div><br></div><div>So I&#39;m just wondering if I&#39;m missing something or this is not implemented yet on Roaster</div><span><font color="#888888"><div><br></div>-- <br>Antonio Goncalves <br>




Software architect and Java Champion<br>
<br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://www.parisjug.org/" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr/" target="_blank">Devoxx France</a>
</font></span></div></div></div>
<br></div></div>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><span><font color="#888888"><br></font></span></blockquote></div><span><font color="#888888"><br>



<br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>
&quot;Simpler is better.&quot;
</font></span></div>
<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>
-- <br>Antonio Goncalves <br>Software architect and Java Champion<br>
<br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://www.parisjug.org/" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr/" target="_blank">Devoxx France</a>
</div></div></div>
</blockquote></div></div></div><div><div><br><br clear="all"><div><br></div>-- <br>Antonio Goncalves <br>Software architect and Java Champion<br><br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank">LinkedIn</a> | <a href="http://www.parisjug.org/" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr/" target="_blank">Devoxx France</a>
</div></div></div>
<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>

&quot;Simpler is better.&quot;
</div></div></div>