On Monday, September 10, 2012 6:36:50 PM UTC+2, Adam Gordon wrote:
>
> I'm building a GWT generator and I'm parsing a class.  I've gotten to the 
> point where i have a JField[] and am iterating over the class fields.  I 
> need to know how to get the value from a field and the GWT documentation is 
> a bit lacking (i.e., non-existent, at least from a javadoc perspective). 
>  Anyone have any insight?  Thanks.


Getting the value of a field is a runtime operation, and a generator runs 
at compile-time. The only thing you can do is generate code that will read 
the field's value and act upon it at runtime, and then hope for the 
compiler to possibly detect that the value is actually constant and thus 
optimize out all the code you generated that would never be reached.

Put differently, imagine the generator runs right within Eclipse (or your 
IDE of choice) and generates *.java files. This is more or less what 
happens actually, except internally during the compilation.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/KEUquRYSMTAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to