You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stephen Colebourne <sc...@btopenworld.com> on 2005/08/04 09:27:09 UTC

Re: [lang] Questions concerning VariableFormatter

Please prefix emails by [lang]

Tom Schindl wrote:
> I just found out that this project has exactly what I was searching for 
> long time because MessageFormat doesn't really suite my needs.
> 
> I see that this Class has been added in 2.2:
> --------------------------------------------
> a. Is there any plan when 2.2 is released
When its ready ;-) No firm dates, but work rate is pretty high at present.

> b. What would be with adding formats applied to values like 
> MessageFormat does it {myDate,date,short}. The attached patch does that 
> simply using MessageFormat.
I agree that this is a good idea if done carefully. However we have no 
plans to do this at present. You might want to propose some 
suggestions/code separately.

> c. Are there any planned changes to VariableFormatter to make it more 
> look like MessageFormat?
Not at present, although its my personal opinion that it should extend 
Format before 2.2 release. You could help code this.

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [lang] Questions concerning VariableFormatter

Posted by Tom Schindl <to...@gmx.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Oliver Heger schrieb:
> Tom Schindl wrote:
> 
>> Stephen Colebourne schrieb:
>>
>> >Please prefix emails by [lang]
>
[...]
> An alternative would be to provide an additional implementation of the
> VariableResolver interface. The default implementation stays as is and
> does not handle formats. An extended implementation could support
> further arguments that are appended to variables.
> 
> Oliver

so i did now and added a new resolver based upon the existing one. What
this patch does:
- - added a new Resolver named MapVariableResolverWithFormats
- - static functions to turn Formats on/off
  => default methods changed to use Formats
- - new constructors

Hope that's better than my first try. I didn't have a enough time to
look closer at how to make VariableFormatter extend Format which I'd
desire most so that the interface between MessageFormat and
VariableFormatter is equal.

> 
> <snip/>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC+I+YkVPeOFLgZFIRAlszAJsGCQ7fdUnKtsho4rEvxliptJMQTACeKv1d
U1wwIvsx++Bw6Rn65CD7yCg=
=5lYH
-----END PGP SIGNATURE-----

Re: [lang] Questions concerning VariableFormatter

Posted by Oliver Heger <ol...@t-online.de>.
Tom Schindl wrote:

> Stephen Colebourne schrieb:
>
> >Please prefix emails by [lang]
>
> >Tom Schindl wrote:
>
> >>I just found out that this project has exactly what I was searching
> >>for long time because MessageFormat doesn't really suite my needs.
> >>
> >>I see that this Class has been added in 2.2:
> >>--------------------------------------------
> >>a. Is there any plan when 2.2 is released
>
> >When its ready ;-) No firm dates, but work rate is pretty high at 
> present.
>
> >>b. What would be with adding formats applied to values like
> >>MessageFormat does it {myDate,date,short}. The attached patch does
> >>that simply using MessageFormat.
>
> >I agree that this is a good idea if done carefully. However we have no
> >plans to do this at present. You might want to propose some
> >suggestions/code separately.
>
>
> Isn't the proposed patch appended to the last mail what could be done to
> stay as compatible with MessageFormat as possible?
> Maybe a flag to VariableFormatter could flag whether a search for
> formats should be done so users not using formats are not hurt by the
> search.

An alternative would be to provide an additional implementation of the 
VariableResolver interface. The default implementation stays as is and 
does not handle formats. An extended implementation could support 
further arguments that are appended to variables.

Oliver

<snip/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [lang] Questions concerning VariableFormatter

Posted by Tom Schindl <to...@gmx.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Colebourne schrieb:
> Please prefix emails by [lang]
> 
> Tom Schindl wrote:
> 
>> I just found out that this project has exactly what I was searching
>> for long time because MessageFormat doesn't really suite my needs.
>>
>> I see that this Class has been added in 2.2:
>> --------------------------------------------
>> a. Is there any plan when 2.2 is released
> 
> When its ready ;-) No firm dates, but work rate is pretty high at present.
> 
>> b. What would be with adding formats applied to values like
>> MessageFormat does it {myDate,date,short}. The attached patch does
>> that simply using MessageFormat.
> 
> I agree that this is a good idea if done carefully. However we have no
> plans to do this at present. You might want to propose some
> suggestions/code separately.

Isn't the proposed patch appended to the last mail what could be done to
stay as compatible with MessageFormat as possible?
Maybe a flag to VariableFormatter could flag whether a search for
formats should be done so users not using formats are not hurt by the
search.

> 
>> c. Are there any planned changes to VariableFormatter to make it more
>> look like MessageFormat?
> 
> Not at present, although its my personal opinion that it should extend
> Format before 2.2 release. You could help code this.

I'll investigate on this.

> 
> Stephen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC8enEkVPeOFLgZFIRApONAJ448NB1ptbeKCPySkIMkWBjMAE+3gCfXkWv
KW4U6CHnKZIkUIBMV2hefcs=
=/ryH
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org