Are there any reflective libraries or methods available to the client?
Specifically I'd like to invoke a method based off the contents of a
String.
See the Language Support topic:
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.JavaToJavaScriptCompiler.LanguageSupport.html
I don't see why that needs reflection.
if(string.compareTo("something")) {
object.invokeSomething();
}
Technically you could replace a lot of reflection with the longest
string of if statements ever seen by manking, but there is a reason
people don't.
That's where reflection becomes necessary. I highly recommend you take
a closer look at it, reflection can be very powerful. For example, it
is a nice way to make GUI components that automatically update a java
object when changed in Swing.
But I can do without in this particular case.
:)