donaldp 01/11/05 15:39:36 Modified: src/scratchpad/org/apache/avalon/excalibur/i18n Bundle.java BundleInfo.java BundleInfoMapper.java BundleLoader.java BundleMatcher.java Log: bracketing. Revision Changes Path 1.4 +3 -4 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/Bundle.java Index: Bundle.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/Bundle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Bundle.java 2001/11/01 15:26:14 1.3 +++ Bundle.java 2001/11/05 23:39:36 1.4 @@ -14,10 +14,10 @@ * This is the interface of the ResourceBundle, for used for i18n support. * * @author <a href="mailto:[EMAIL PROTECTED]">Neeme Praks</a> - * @version CVS $Revision: 1.3 $ $Date: 2001/11/01 15:26:14 $ $Author: colus $ + * @version CVS $Revision: 1.4 $ $Date: 2001/11/05 23:39:36 $ $Author: donaldp $ */ -public interface Bundle { - +public interface Bundle +{ /** * Initalize the bundle * @@ -96,5 +96,4 @@ * @param lastModified last modification time */ void setLastModified(long lastModified); - } 1.3 +30 -18 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleInfo.java Index: BundleInfo.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleInfo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BundleInfo.java 2001/11/02 19:41:48 1.2 +++ BundleInfo.java 2001/11/05 23:39:36 1.3 @@ -13,45 +13,53 @@ * Used to map locale information to URI space, to find the relevant bundle. * * @author <a href="mailto:[EMAIL PROTECTED]">Neeme Praks</a> - * @version CVS $Revision: 1.2 $ $Date: 2001/11/02 19:41:48 $ $Author: neeme $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/05 23:39:36 $ $Author: donaldp $ */ -public class BundleInfo { - +public class BundleInfo +{ private String name; private Locale locale; private String ext; - public BundleInfo(String name, Locale locale, String ext) { + public BundleInfo(String name, Locale locale, String ext) + { this.name = name; this.locale = locale; this.ext = ext; } - public BundleInfo(String name, Locale locale) { + public BundleInfo(String name, Locale locale) + { this(name, locale, null); } - public BundleInfo(Locale locale) { + public BundleInfo(Locale locale) + { this(null, locale); } - public String getName() { + public String getName() + { return this.name; } - public Locale getLocale() { + public Locale getLocale() + { return this.locale; } - public String getExtensionParameter() { + public String getExtensionParameter() + { return this.ext; } - public String toString() { + public String toString() + { return "BundleInfo(" + this.name + "," + this.locale + "," + this.ext + ")"; } - public BundleInfo getParent() { + public BundleInfo getParent() + { if (this.locale != null && !this.locale.getLanguage().equals("")) return new BundleInfo(this.name, this.getParentLocale(), this.ext); else @@ -66,9 +74,11 @@ * @param locale the locale * @return the parent locale */ - protected Locale getParentLocale() { + protected Locale getParentLocale() + { Locale newloc; - if (this.locale.getVariant().equals("")) { + if (this.locale.getVariant().equals("")) + { if (this.locale.getCountry().equals("")) newloc = new Locale("","",""); else @@ -80,20 +90,23 @@ return newloc; } - public boolean matches(BundleInfo info) { + public boolean matches(BundleInfo info) + { return match(this.name, info.getName()) && match(this.locale, info.getLocale()) && match(this.ext, info.getExtensionParameter()); } - protected boolean match(String str, String reference) { + protected boolean match(String str, String reference) + { if (str == null) return true; if (reference == null) return false; return str.equals(reference); } - protected boolean match(Locale locale, Locale reference) { + protected boolean match(Locale locale, Locale reference) + { if (locale == null) return true; if (reference == null) return false; return @@ -101,5 +114,4 @@ match(locale.getCountry(), reference.getCountry()) && match(locale.getVariant(), reference.getVariant()); } - -} \ No newline at end of file +} 1.3 +3 -3 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleInfoMapper.java Index: BundleInfoMapper.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleInfoMapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BundleInfoMapper.java 2001/11/01 15:26:14 1.2 +++ BundleInfoMapper.java 2001/11/05 23:39:36 1.3 @@ -12,10 +12,10 @@ * to find the relevant bundle. * * @author <a href="mailto:[EMAIL PROTECTED]">Neeme Praks</a> - * @version CVS $Revision: 1.2 $ $Date: 2001/11/01 15:26:14 $ $Author: colus $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/05 23:39:36 $ $Author: donaldp $ */ -public interface BundleInfoMapper { - +public interface BundleInfoMapper +{ /** * Get the string form of the bundle, based on bundle info. * 1.3 +4 -3 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleLoader.java Index: BundleLoader.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BundleLoader.java 2001/11/01 15:26:14 1.2 +++ BundleLoader.java 2001/11/05 23:39:36 1.3 @@ -13,10 +13,11 @@ * Used to map locale information to URI space, to find the relevant bundle. * * @author <a href="mailto:[EMAIL PROTECTED]">Neeme Praks</a> - * @version CVS $Revision: 1.2 $ $Date: 2001/11/01 15:26:14 $ $Author: colus $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/05 23:39:36 $ $Author: donaldp $ */ -public interface BundleLoader extends Configurable { - +public interface BundleLoader + extends Configurable +{ /** * Load a bundle, based on bundleInfo. * 1.3 +6 -6 jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleMatcher.java Index: BundleMatcher.java =================================================================== RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/i18n/BundleMatcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BundleMatcher.java 2001/11/02 19:36:17 1.2 +++ BundleMatcher.java 2001/11/05 23:39:36 1.3 @@ -14,15 +14,15 @@ * to find the relevant bundle. * * @author <a href="mailto:[EMAIL PROTECTED]">Neeme Praks</a> - * @version CVS $Revision: 1.2 $ $Date: 2001/11/02 19:36:17 $ $Author: neeme $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/05 23:39:36 $ $Author: donaldp $ */ -public interface BundleMatcher extends Configurable { - +public interface BundleMatcher + extends Configurable +{ /** * Get the string form of the bundle, based on bundle info. * * @return the string form */ - public String getType(BundleInfo bundleInfo); - -} \ No newline at end of file + String getType(BundleInfo bundleInfo); +}
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>