The minimal requirements are:

> * retrieve the properties of a bean via bean class
> * read a property value from a bean via bean instance and property name
> * write a property value in a bean via bean instance, property name and 
> value
> * determine the type of a property via bean class and property name
>
> One final to add:
  * create a new instance of the bean via bean class [uses (public) non-arg 
constructor].
 

> I see two problems to discuss:
> 1. There is no common Java API for bean introspection that is suitable 
> here. We should check if there is one that is most commonly accepted or 
> wheter we should create a new one.
> However, the API should be more on the scope of a JSR (I do not want to 
> make it too complicated and go for a real JSR) and not be inside a 
> gwt-user.jar that many architects do not want to see on the server as a 
> dependency for common code modules.
> 2. How to determine which beans to support in the GWT reflection? 
> Supporting all beans would be too much overhead. Requiring GWT.create for 
> each bean would conflict with other purposes of generation as unfortunately 
> GWT.create does not take the expected result type as 2nd arg. So maybe 
> something like configurable marker interfaces might be a solution. Also 
> java.io.Serializable could be a candidate.
>

One thing to add here:
The full JDK implementation of the Relection API should be able to deal 
with generics and should therefore accept java.lang.reflect.Type. This way 
one could also provide a generic type and resolve the real type of a 
generic property. E.g.:
public class MyGenericBean<T> {
  private T value;
  public T getValue() {
    return this.value;
  }
  public void setValue(T value) {
    this.value = value;
  }
}
Then 

Type type = getTypeOf("MyGenericBean<Integer>");
Type propertyType = reflectionUtil.getPropertyType(type, "value");

should result in the propertyType Integer.
This should not be supported in GWT environments but the API should not 
prevent such usage in regular JREs.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to