Actually, you can't decorate TypeCoercer, so you are basically out of luck.

However, since you are talking about encoding and decoding data in
URLs and query parameters, you can work with the ValueEncoderSource
instead!  It has a more flexible, more forgiving configuration.

On Mon, Oct 4, 2010 at 1:51 AM, Christian Köberl
<[email protected]> wrote:
>
> The problem is that Tapestry itself is already adding this Coercion:
>
> TapestryIOCModule:
>        add(configuration, String.class, Long.class, new Coercion<String,
> Long>()
>        {
>            public Long coerce(String input)
>            {
>                return new Long(input);
>            }
>        });
>
> So, the only possible way is to decorate (override) the TypeCoercer and
> return your implementation on coerce.
> --
> View this message in context: 
> http://tapestry-users.832.n2.nabble.com/Custom-coercion-from-String-to-Long-tp5582965p5598307.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to