You can do it in real java, but as reflection is not supported in GWT it would
not work in GWT.
In real java you would say:-
Test test = new Test();
Test.getClass().getField(value).set(test,some value);
Note that if value is a private or protected field then you need to use
getDeclaredField
Hi David,
having worked 10 years in Java I know how to use reflection:) Sorry it
was not obvious from my post - I was just inquiring whether there's a
GWT method that could be used in client code - some method that
escaped my search.
Anyway, I've solved this problem yesterday by writing a
When you have a typed class, say
class Test {
String value;
}
is it somehow possible to set field 'value' without a static reference
in the code?
I'm looking for an equivalent to JavaScript's:
var Test = { };
Test[value] = some value;
JSNI can access a java field via the