Re: FormatNumberTag
I didn't explain myself well. Basically I would insert reconfigureFormatter(NumberFormat/DateFormat) inside doEndTag. By default it would nothing. On Fri, Jul 10, 2009 at 5:03 AM, Stuart Thiel wrote: > Hello Henri, > > Having a protected configureFormatter (and similar things for other methods > elsewhere) is my preferred approach. > > The issue with the second approach is that doEndTag() calls > createFormatter(), then configureFormatter, then formats the text. There's > no facility to step in between and make changes. If the other methods stayed > private, we'd have to re-implement them if we re-implemented doEndTag() > anyway. So there is nothing gained by having a > reconfigureFormatter(DateFormat). > > On Fri, Jul 10, 2009 at 3:25 AM, Henri Yandell wrote: > >> I'm wondering if protected configureFormatter(NumberFormat) is best, >> or if the better option is to have a protected void >> reconfigureFormatter(NumberFormat) method that is invokved at the end >> of that method. >> >> So by default the configureFormatter is always run, and then the user >> can hook in to do whatever they want to the NumberFormat. A similar >> reconfigureFormatter(DateFormat) could be added to the >> FormatDateSupport class. >> >> What do you think? >> >> > -- > Stuart Thiel > - To unsubscribe, e-mail: taglibs-user-unsubscr...@jakarta.apache.org For additional commands, e-mail: taglibs-user-h...@jakarta.apache.org
Re: FormatNumberTag
Hello Henri, Having a protected configureFormatter (and similar things for other methods elsewhere) is my preferred approach. The issue with the second approach is that doEndTag() calls createFormatter(), then configureFormatter, then formats the text. There's no facility to step in between and make changes. If the other methods stayed private, we'd have to re-implement them if we re-implemented doEndTag() anyway. So there is nothing gained by having a reconfigureFormatter(DateFormat). On Fri, Jul 10, 2009 at 3:25 AM, Henri Yandell wrote: > I'm wondering if protected configureFormatter(NumberFormat) is best, > or if the better option is to have a protected void > reconfigureFormatter(NumberFormat) method that is invokved at the end > of that method. > > So by default the configureFormatter is always run, and then the user > can hook in to do whatever they want to the NumberFormat. A similar > reconfigureFormatter(DateFormat) could be added to the > FormatDateSupport class. > > What do you think? > > -- Stuart Thiel
Re: FormatNumberTag
I'm wondering if protected configureFormatter(NumberFormat) is best, or if the better option is to have a protected void reconfigureFormatter(NumberFormat) method that is invokved at the end of that method. So by default the configureFormatter is always run, and then the user can hook in to do whatever they want to the NumberFormat. A similar reconfigureFormatter(DateFormat) could be added to the FormatDateSupport class. What do you think? On Wed, Jul 8, 2009 at 1:55 PM, Stuart Thiel wrote: > Hello, > > A number of useful methods seem to be private. It makes sub-classing the > taglibs inconvenient. > > For example, I would like to extend FormatNumberTag so that I can change the > grouping separator. If configureFormatter in > org.apache.taglibs.standard.tag.common.fmt.FormatNumberSupport were > protected, instead of private, I could simply wrap it up and extend it in a > few lines of code and let polymorphism do its thing. > > As it stands, I'll need to duplicate most of the code from > FormatNumberSupport. > > -- > Stuart Thiel > - To unsubscribe, e-mail: taglibs-user-unsubscr...@jakarta.apache.org For additional commands, e-mail: taglibs-user-h...@jakarta.apache.org