jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: [NEW] Converter chaining, global converters

From: Bauke Scholtz <balusc_at_gmail.com>
Date: Thu, 11 Dec 2014 18:37:34 +0100

Not sure about chained converters. Feels a bit clumsy and dangerous. Just
extend the desired converter. E.g. public class SomeConverter extends
LongConverter {} and delegate to super. Okay, you've to cast, but that's a
different problem which can be solved by just parameterizing the existing
Converter interface.

Cheers, B

On Thu, Dec 11, 2014 at 6:27 PM, Kito Mann <kito.mann_at_virtua.com> wrote:

> There are certainly ways to implement this, but it seems strange that
> there isn't a global way to process input. Moreover, I've thought for a
> while that it'd be nice to have more than one converter...
>
> ___
>
> Kito D. Mann | @kito99 | Author, JSF in Action
> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
> http://www.JSFCentral.com | @jsfcentral
> +1 203-998-0403
>
> * Listen to the Enterprise Java Newscast: *http://
> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
> <http://ww.enterprisejavanews.com>*
> * JSFCentral Interviews Podcast:
> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
> * Sign up for the JSFCentral Newsletter:
> http://oi.vresp.com/?fid=ac048d0e17
>
> On Thu, Dec 11, 2014 at 11:04 AM, manfred riem <manfred.riem_at_oracle.com>
> wrote:
>
>> Hi Kito,
>>
>> A phase listener would not do the trick for you?
>>
>> Note unless I am mistaken what you are describing seems more like a
>> corner case to me?
>>
>> Thanks!
>> Manfred
>>
>>
>> On 12/11/14, 9:56 AM, Kito Mann wrote:
>>
>> Hello everyone,
>>
>> On my current project, I have a situation where I'd like to process
>> input from _every_ JSF input component on the page. There are a few
>> different ways I can do this, but what I really want is to be able to apply
>> a global converter, much like global validators. However, in order to do
>> this, we would have to have some sort of "converter chaining" mechanism so
>> that existing converters won't get clobbered. I could implement this by
>> walking through all of the EditableValueHolders in the view and adding a
>> special converter that can wrap an existing converter if necessary.
>> However, this is something that would work well at the spec level. Thoughts?
>> ___
>>
>> Kito D. Mann | @kito99 | Author, JSF in Action
>> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and
>> consulting
>> http://www.JSFCentral.com | @jsfcentral
>> +1 203-998-0403
>>
>> * Listen to the Enterprise Java Newscast: *http://
>> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
>> <http://ww.enterprisejavanews.com>*
>> * JSFCentral Interviews Podcast:
>> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
>> * Sign up for the JSFCentral Newsletter:
>> http://oi.vresp.com/?fid=ac048d0e17
>>
>>
>