On Monday, September 10, 2012 7:16:05 PM UTC+2, Adam Gordon wrote: > > They Thomas, thanks for the quick reply. > > Yea. Sorry about that. I should have been more clear. I realized that, > at least for my implementation, reading the field isn't exactly what I > wanted. > > I'm writing writing generators to generate bean validator classes, only > the bean fields are annotated with custom annotations that dictate the > requirements of the field (which come from some industry specs). We cannot > use a JSR-303 solution (which probably would have been the easiest) because > we cannot introduce a 3rd party dependency on our beans (even though we > already using JAXB, so this requirement seems a bit silly). > > The path I went down was to generate a validate(FooBean bean) method and > using GWT reflection iterate over the fields of the bean looking for my > annotation. If present, get the details and then attempt to validate that > the bean method parameter validated according to the annotations. What I > realized is that I don't need access to the field value, rather, I need to > execute a getter method on the bean and validate that value - only, there's > no way to map the bean methods to whatever field on which I'm iterating. >
What's wrong with accessing the field directly? (using JSNI to bypass the Java access rules) Maybe have a look at the kind of code generated by the JSR303 built-in support. -- 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/-/C7RZAp7O1W8J. 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.
