[i18n] suggestion
What do you think about rename class LocalizedBundle to AbstractEntry? Woody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[i18n] suggestion patch
final enhancements Index: LocalizedText.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18 n/LocalizedText.java,v retrieving revision 1.1 diff -u -r1.1 LocalizedText.java --- LocalizedText.java 4 Oct 2004 13:41:09 - 1.1 +++ LocalizedText.java 1 Feb 2005 03:16:21 - @@ -25,29 +25,29 @@ import java.util.Locale; public class LocalizedText extends LocalizedBundle { -public final static String TEXT = text; +private static final String TEXT = text; -public LocalizedText(String messageId) { +public LocalizedText(final String messageId) { super(messageId); } -public LocalizedText(String messageId, Object[] arguments) { +public LocalizedText(final String messageId, final Object[] arguments) { super(messageId, arguments); } public String getText() throws MessageNotFoundException { -return getText(TEXT, Locale.getDefault()); +return getEntry(TEXT, Locale.getDefault()); } -public String getText(Locale locale) throws MessageNotFoundException { -return getText(TEXT, locale); +public String getText(final Locale locale) throws MessageNotFoundException { +return getEntry(TEXT, locale); } -public String getText(String defaultText) { -return getText(TEXT, defaultText, Locale.getDefault()); +public String getText(final String defaultText) { +return getEntry(TEXT, defaultText, Locale.getDefault()); } -public String getText(Locale locale, String defaultText) { -return getText(TEXT, defaultText, locale); +public String getText(final Locale locale, final String defaultText) { +return getEntry(TEXT, defaultText, locale); } } \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[i18n] suggestion patch - LocalizedError.java
final enhacements Index: LocalizedError.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18 n/LocalizedError.java,v retrieving revision 1.1 diff -u -r1.1 LocalizedError.java --- LocalizedError.java 4 Oct 2004 13:41:09 - 1.1 +++ LocalizedError.java 1 Feb 2005 03:24:20 - @@ -28,43 +28,43 @@ private final static String SUMMARY = summary; private final static String DETAILS = details; -public LocalizedError(String messageId) { +public LocalizedError(final String messageId) { super(messageId); } -public LocalizedError(String messageId, Object[] arguments) { +public LocalizedError(final String messageId, final Object[] arguments) { super(messageId, arguments); } public String getSummary() throws MessageNotFoundException { -return getText(SUMMARY, Locale.getDefault()); +return getEntry(SUMMARY, Locale.getDefault()); } -public String getSummary(Locale locale) throws MessageNotFoundException { -return getText(SUMMARY, locale); +public String getSummary(final Locale locale) throws MessageNotFoundException { +return getEntry(SUMMARY, locale); } -public String getSummary(String defaultSummary) { -return getText(SUMMARY, defaultSummary, Locale.getDefault()); +public String getSummary(final String defaultSummary) { +return getEntry(SUMMARY, defaultSummary, Locale.getDefault()); } -public String getSummary(Locale locale, String defaultSummary) { -return getText(SUMMARY, defaultSummary, locale); +public String getSummary(final Locale locale, final String defaultSummary) { +return getEntry(SUMMARY, defaultSummary, locale); } public String getDetails() throws MessageNotFoundException { -return getText(DETAILS, Locale.getDefault()); +return getEntry(DETAILS, Locale.getDefault()); } -public String getDetails(Locale locale) throws MessageNotFoundException { -return getText(DETAILS, locale); +public String getDetails(final Locale locale) throws MessageNotFoundException { +return getEntry(DETAILS, locale); } -public String getDetails(String defaultDetails) { -return getText(DETAILS, defaultDetails, Locale.getDefault()); +public String getDetails(final String defaultDetails) { +return getEntry(DETAILS, defaultDetails, Locale.getDefault()); } -public String getDetails(Locale locale, String defaultDetails) { -return getText(DETAILS, defaultDetails, locale); +public String getDetails(final Locale locale, final String defaultDetails) { +return getEntry(DETAILS, defaultDetails, locale); } } \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[i18n] suggestion patch - LocalizedException
final enhancements Index: LocalizedException.java === RCS file: /home/cvspublic/jakarta-commons-sandbox/i18n/src/java/org/apache/commons/i18 n/LocalizedException.java,v retrieving revision 1.1 diff -u -r1.1 LocalizedException.java --- LocalizedException.java 4 Oct 2004 13:41:09 - 1.1 +++ LocalizedException.java 1 Feb 2005 03:27:55 - @@ -25,19 +25,19 @@ import java.util.Locale; public class LocalizedException extends Exception { -private LocalizedError errorMessage; +private final LocalizedError errorMessage; -public LocalizedException(LocalizedError errorMessage, Throwable throwable) { +public LocalizedException(final LocalizedError errorMessage, final Throwable throwable) { super(errorMessage.getSummary(Locale.getDefault(), throwable.getMessage()), throwable); this.errorMessage = errorMessage; } -public LocalizedException(LocalizedError errorMessage) { +public LocalizedException(final LocalizedError errorMessage) { super(errorMessage.getSummary(Locale.getDefault(), no message available)); this.errorMessage = errorMessage; } public LocalizedError getErrorMessage() { -return errorMessage; +return this.errorMessage; } } \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[i18n] suggestion/problem ...
Well, once MessageManager (and everything inside) is static we can have only one manager to all aplications running on vm. What you think to do when we need one diferent manager, by example, to supply another application ? I dono what messages id this application will have but if there is some id repeated this will overrides messages across aplications ... Woody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [i18n] suggestion
What do you think about rename class LocalizedBundle to LocalizedEntry? I think this is a better name ... Woody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]