You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ja...@carmanconsulting.com on 2003/09/11 17:08:09 UTC

[collections] Potential New Additions?

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.
2.  PropertyValueTransformer - Returns the value of a property.  Currently
uses BeanUtils, but could be migrated to use BeanMap instead.
3.  StringValueTransformer - Returns the value of String.valueOf(), passing
in the original object.
4.  PropertyValuePredicate - Returns true if the property has a desired
target value.
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).  Could be used if you wanted the String value of a
property of the bean.  You would add a PropertyValueTransformer and then a
StringValueTransformer.

Please let me know what you think.

James Carman, President
Carman Consulting, Inc.
1218 Bob White Ct.
Edgewood, KY 41018
(513) 325-7977


Re: [collections] Potential New Additions?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
To write a patch see http://jakarta.apache.org/site/getinvolved.html
Patches should be submitted to Bugzilla so they don't get lost.
thanks

Stephen

----- Original Message -----
From: <ja...@carmanconsulting.com>
> Ahhh.  No problem.  I'm kind of new to this stuff, so how do I submit a
> patch to add StringValueTransformer?
>
> ----- Original Message -----
> From: "Stephen Colebourne" <sc...@btopenworld.com>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Thursday, September 11, 2003 12:30 PM
> Subject: Re: [collections] Potential New Additions?
>
>
> > Ahh, my minds on holiday plans ATM....
> >
> > Still a good transformer addition though.
> >
> > Stephen
> >
> > ----- Original Message -----
> > From: <ja...@carmanconsulting.com>
> > > There is no reason to have a toString() transformer.  String.valueOf()
> > calls
> > > toString().
> > >
> > > ----- Original Message -----
> > > From: "Stephen Colebourne" <sc...@btopenworld.com>
> > > To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> > > Sent: Thursday, September 11, 2003 11:35 AM
> > > Subject: Re: [collections] Potential New Additions?
> > >
> > >
> > > > From: <ja...@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
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>


Re: [collections] Potential New Additions?

Posted by ja...@carmanconsulting.com.
Ahhh.  No problem.  I'm kind of new to this stuff, so how do I submit a
patch to add StringValueTransformer?

----- Original Message ----- 
From: "Stephen Colebourne" <sc...@btopenworld.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Thursday, September 11, 2003 12:30 PM
Subject: Re: [collections] Potential New Additions?


> Ahh, my minds on holiday plans ATM....
>
> Still a good transformer addition though.
>
> Stephen
>
> ----- Original Message -----
> From: <ja...@carmanconsulting.com>
> > There is no reason to have a toString() transformer.  String.valueOf()
> calls
> > toString().
> >
> > ----- Original Message -----
> > From: "Stephen Colebourne" <sc...@btopenworld.com>
> > To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> > Sent: Thursday, September 11, 2003 11:35 AM
> > Subject: Re: [collections] Potential New Additions?
> >
> >
> > > From: <ja...@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
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>


Re: [collections] Potential New Additions?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
Ahh, my minds on holiday plans ATM....

Still a good transformer addition though.

Stephen

----- Original Message -----
From: <ja...@carmanconsulting.com>
> There is no reason to have a toString() transformer.  String.valueOf()
calls
> toString().
>
> ----- Original Message -----
> From: "Stephen Colebourne" <sc...@btopenworld.com>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Thursday, September 11, 2003 11:35 AM
> Subject: Re: [collections] Potential New Additions?
>
>
> > From: <ja...@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
>


Re: [collections] Potential New Additions?

Posted by ja...@carmanconsulting.com.
There is no reason to have a toString() transformer.  String.valueOf() calls
toString().

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


> From: <ja...@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
>
>
>


RE: [collections] Potential New Additions?

Posted by Norm Deane <no...@vanderbilt.edu>.
> > 4.  PropertyValuePredicate - Returns true if the property has a 
> > desired target value.
> Would go to [beanutils]
> 

Also recently added to BeanUtils.  See BeanPropertyValueEqualsPredicate.

--Norm


Re: [collections] Potential New Additions?

Posted by Stephen Colebourne <sc...@btopenworld.com>.
From: <ja...@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