yes. with the current implementation there will never ever be a null
returned. Either a non-null default value, an exception or the default
not-found-text.
Juergen
On 10/22/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> so the real change from the outside is that when you now specify a default
> value that is null it will still throw an exception
> and this will not happen when we make the change?
>
> seems fine to me.
>
>
>
> On 10/21/05, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
> >
> > IMO Localizer.getString() is bit akward to use. It currently looks like
> >
> > public String getString(final String key, final Component
> component,
> > final IModel model,
> > final Locale locale, final String style, final
> String defaultValue)
> > throws MissingResourceException
> > {
> > ....
> > // Resource not found, so handle missing resources based
> on application
> > // configuration
> > if
> (settings.getUseDefaultOnMissingResource() && defaultValue
> != null)
> > {
> > return defaultValue;
> > }
> >
> > if
> (settings.getThrowExceptionOnMissingResource())
> > {
> > throw new
> MissingResourceException("Unable to find resource: " +
> > key, getClass()
> > .getName(), key);
> > }
> > else
> > {
> > return "[Warning: String resource for '" + key +
> "' not found]";
> > }
> > }
> >
> > What I would like to change:
> > Define two getString() methods. One with defaultValue and one without.
> > If defaultValue method is used, return the defaultValue if the
> > resourcekey is not found, no matter whether defaultValue is null or
> > not. And remove getUseDefaultOnMissingResource() from the
> API.
> > getString() without defaultValue throws an exception, if settings flag
> > is true and resourcekey was not found. Else call
> > getDefaultErrorText(key) to construct a default key.
> > In order to allow for subclassing Localizer we implement
> > newLocalizer() { this.localizer = new Localizer()} in wicket
> > application.
> > IMO is would make Localizer.getString more easy and straight forward
> > to use, besides that it would be extensible now, if realy required.
> >
> > what do you think?
> > Jürgen
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by:
> > Power Architecture Resource Center: Free content, downloads, discussions,
> > and more. http://solutions.newsforge.com/ibmarch.tmpl
> > _______________________________________________
> > Wicket-develop mailing list
> > [email protected]
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop