commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arun Thomas" <Arun.Tho...@solidusnetworks.com>
Subject RE: [collections] Potential New Additions?
Date Thu, 11 Sep 2003 16:30:11 GMT
James, 

The key is that it's a "Transformer", not that it calls toString().  It's a utility class
so that everyone doesn't have to roll their own implementation of the Transformer interface
which simply calls String.valueOf() - I'm pretty sure that's what this impl does....

-AMT

-----Original Message-----
From: james@carmanconsulting.com [mailto:james@carmanconsulting.com] 
Sent: Thursday, September 11, 2003 8:37 AM
To: commons-dev@jakarta.apache.org
Subject: Re: [collections] Potential New Additions?


There is no reason to have a toString() transformer.  String.valueOf() calls toString().

----- Original Message ----- 
From: "Stephen Colebourne" <scolebourne@btopenworld.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Thursday, September 11, 2003 11:35 AM
Subject: Re: [collections] Potential New Additions?


> From: <james@carmanconsulting.com>
> > I have a few classes that I have found useful on numerous projects 
> > and
> they
> > are just general enough that they might be a nice addition to the
Commons
> > Collections library...
> >
> > 1.  IdentityTransformer - Returns the original object.  This is 
> > useful
for
> > frameworks which use a Transformer, but do not wish to perform a 
> > null
> check.
> TransformerUtils.nopTransformer()
>
> > 2.  PropertyValueTransformer - Returns the value of a property.
Currently
> > uses BeanUtils, but could be migrated to use BeanMap instead.
> See [beanutils] recent addition IIRC.
>
> > 3.  StringValueTransformer - Returns the value of String.valueOf(),
> passing
> > in the original object.
> Could have value. Also ToStringTransformer.
>
> > 4.  PropertyValuePredicate - Returns true if the property has a 
> > desired target value.
> Would go to [beanutils]
>
> > 5.  TransformerChain - Implements the Transformer interface and 
> > allows
you
> > to chain together a list of Transformer objects.  Transformations 
> > are applied in the order in which they were added to the chain 
> > (similar to ComparatorChain).
> TransformerUtils.chainedTransformer()
>
> The TransformerUtils class is in CVS, but not yet released.
>
> The StringValueOf and ToString transformers would probably be useful 
> if
you
> want to submit a tested patch :-)
>
> Stephen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message