From dev-return-105197-apmail-commons-dev-archive=commons.apache.org@commons.apache.org Fri Oct 05 18:09:47 2007 Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 96581 invoked from network); 5 Oct 2007 18:09:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 18:09:43 -0000 Received: (qmail 73895 invoked by uid 500); 5 Oct 2007 18:09:30 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 73824 invoked by uid 500); 5 Oct 2007 18:09:30 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 73815 invoked by uid 99); 5 Oct 2007 18:09:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 11:09:30 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.162.236] (HELO nz-out-0506.google.com) (64.233.162.236) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 18:09:31 +0000 Received: by nz-out-0506.google.com with SMTP id m22so541486nzf for ; Fri, 05 Oct 2007 11:08:53 -0700 (PDT) Received: by 10.142.52.9 with SMTP id z9mr1732024wfz.1191607698691; Fri, 05 Oct 2007 11:08:18 -0700 (PDT) Received: by 10.142.110.16 with HTTP; Fri, 5 Oct 2007 11:08:18 -0700 (PDT) Message-ID: Date: Fri, 5 Oct 2007 14:08:18 -0400 From: "James Carman" Sender: jcarman@carmanconsulting.com To: "Jakarta Commons Developers List" Subject: Re: [lang] notice of itch to commit In-Reply-To: <590921.30381.qm@web55103.mail.re4.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <31cc37360710041637h30a25ce7m515410e2f79dea85@mail.gmail.com> <590921.30381.qm@web55103.mail.re4.yahoo.com> X-Google-Sender-Auth: 27b03bb6b571dde6 X-Virus-Checked: Checked by ClamAV on apache.org You mean this extension would allow some sort of "registry" which is keyed by the second argument of the format expression? So, I could do something like... ExtendedMessageFormat fmt = new ExtendedMessageFormat(); fmt.addFormatHandler("foo", new MyFooHandler() ); String str = fmt.format("Hello, {0,foo}!", "James Carman"); Now maybe you'd register the "handler" globally, but you get the idea. On 10/5/07, Matt Benson wrote: > > --- Henri Yandell wrote: > > > Out of interest; related to a JIRA issue? > > > > Actually no. I guess I'll go ahead and lay my cards > on the table in case anyone has any wisdom for me. An > obviously missing piece of java.text.MessageFormat is > the ability to plug in other custom formatters. I've > only seen one OSS project (msg at java.net) that > addresses this, and it has a dubious configuration > mechanism (magic XML classpath resource) and an IMHO > useless inheritance hierarchy i.e. > java.lang.Object--the project claims its > XMessageFormat is a "drop-in replacement" but > apparently their idea of drop-in differs from mine. > IMO such a solutiion would necessarily need to extend > Format and very likely MessageFormat as well; a Format > implicitly understood to operate upon Object[] is good > enough from a javadoc POV but I have the feeling that > much existing code would cope better with a > MessageFormat subclass. For these reasons I assert > that I am not just indulging in NIH. Lang already > provides the CompositeFormat in o.a.c.lang.text; this > constitutes IMO a precedent for custom Formats to live > in Lang. It is my intent to create > o.a.c.lang.text.ExtendedMessageFormat (extends > java.text.MessageFormat) with a pluggable means of > resolving delegate formatters (optionally) specified > with each "format element". My intent is to provide a > subclass whose default behavior is identical to its > parent class but provides extensibility for plugging > in custom formats. > > Comments? > > -Matt > > > On 10/4/07, Matt Benson > > wrote: > > > in org.apache.commons.lang.text > > > > > > -Matt > > > > > > > > > > > > > > > ____________________________________________________________________________________ > > > Pinpoint customers who are looking for what you > > sell. > > > http://searchmarketing.yahoo.com/ > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > dev-unsubscribe@commons.apache.org > > > For additional commands, e-mail: > > dev-help@commons.apache.org > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > dev-unsubscribe@commons.apache.org > > For additional commands, e-mail: > > dev-help@commons.apache.org > > > > > > > > > > ____________________________________________________________________________________ > Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. > http://farechase.yahoo.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org