All,

I put in a Bugzilla request for an IndexTransformer class.  Basically, it
just returns the value from the input (input can be List, array, String, or
StringBuffer) at a specified index.  We've used a similar class in our
application when we want to put the values from a query result (Collection
of Object[]) into a map.  We do something like this...

public void populateMap( Map map, Collection objects, Transformer
keyTransformer, Transformer valueTransformer );

And, you'd use it like this (assuming we did something like select x.id,
x.name from SomeClass x)...

populateMap( map, queryResults, new IndexTransformer(0), new
IndexTransformer(1));

Do you think I could also add the populateMap method (there's another flavor
of it that just uses the object itself as the value using a no-op
transformer)?

James



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to