pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Brind <bri...@brindy.org.uk>
Subject WTKXSerializer#bind
Date Tue, 03 Nov 2009 21:17:13 GMT
Hi,

Just wondering what the logic is behind having two arguments for the
bind method on the WTKXSerializer?

Instead of:

>    public <T> void bind(T t, Class<? super T> type) throws BindException
{
>        Field[] fields = type.getDeclaredFields();

Why not:

>    public <T> void bind(T t) throws BindException {
>        Field[] fields = t.getClass().getDeclaredFields();

In fact, why is this parameterised at all?  Wouldn't this suffice?

>    public void bind(Object t) throws BindException {
>        Field[] fields = t.getClass().getDeclaredFields();


Cheers,
Chris

Mime
View raw message