Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv10934
Modified Files:
LocalizedString.java WrappedLocalizedString.java
Added Files:
ReadonlyLocalizedString.java
Log Message:
Added a 'ReadonlyLocalizedString' which will be used to wrap LocalizedString's
of 'finished' datatypes in
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util
ReadonlyLocalizedString.java is new
Index: LocalizedString.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/LocalizedString.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- LocalizedString.java 27 Apr 2009 16:41:24 -0000 1.36
+++ LocalizedString.java 27 Apr 2009 17:14:00 -0000 1.37
@@ -32,7 +32,7 @@
*</p>
*
* @author Michiel Meeuwissen
- * @version $Id: LocalizedString.java,v 1.36 2009/04/27 16:41:24 michiel Exp $
+ * @version $Id: LocalizedString.java,v 1.37 2009/04/27 17:14:00 michiel Exp $
* @since MMBase-1.8
*/
public class LocalizedString implements java.io.Serializable,
PublicCloneable<LocalizedString> {
@@ -208,6 +208,14 @@
return Collections.unmodifiableMap(values);
}
+ protected Map<Locale, String> getValues() {
+ return values;
+ }
+
+ protected String getBundle() {
+ return bundle;
+ }
+
/**
* A resource-bundle with given name can be associated to this
LocalizedString. If no
* translations were explicitely added, it can be used to look up the
translation in the bundle,
@@ -422,9 +430,9 @@
if (o instanceof LocalizedString) {
LocalizedString os = (LocalizedString) o;
return
- key.equals(os.key) &&
- (values == null ? os.values == null :
values.equals(os.values)) &&
- (bundle == null ? os.bundle == null : bundle.equals(os.bundle))
+ key.equals(os.getKey()) &&
+ (values == null ? os.getValues() == null :
values.equals(os.getValues())) &&
+ (bundle == null ? os.getBundle() == null :
bundle.equals(os.getBundle()))
;
} else {
return false;
Index: WrappedLocalizedString.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/WrappedLocalizedString.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- WrappedLocalizedString.java 23 Aug 2008 18:56:31 -0000 1.2
+++ WrappedLocalizedString.java 27 Apr 2009 17:14:00 -0000 1.3
@@ -16,7 +16,7 @@
* Extends and wraps LocalizedString.
*
* @author Michiel Meeuwissen
- * @version $Id: WrappedLocalizedString.java,v 1.2 2008/08/23 18:56:31 michiel
Exp $
+ * @version $Id: WrappedLocalizedString.java,v 1.3 2009/04/27 17:14:00 michiel
Exp $
* @since MMBase-1.9
*/
public class WrappedLocalizedString extends LocalizedString {
@@ -27,11 +27,6 @@
protected LocalizedString wrapped;
private Locale defaultLocale = null;
- // just for the contract of Serializable
- protected WrappedLocalizedString() {
-
- }
-
/**
* @param s The wrapped LocalizedString.
*/
@@ -46,32 +41,47 @@
return prev;
}
- //javadoc inherited
+
+ @Override
public String getKey() {
return wrapped.getKey();
}
- //javadoc inherited
+ @Override
public void setKey(String key) {
wrapped.setKey(key);
}
- // javadoc inherited
+ @Override
public String get(Locale locale) {
if (locale == null) locale = defaultLocale;
return wrapped.get(locale);
}
- //javadoc inherited
+ @Override
public void set(String value, Locale locale) {
wrapped.set(value, locale);
}
+ @Override
+ public Map<Locale, String> asMap() {
+ return wrapped.asMap();
+ }
- // javadoc inherited
+ @Override
public void setBundle(String b) {
wrapped.setBundle(b);
}
+ @Override
+ protected String getBundle() {
+ return wrapped.getBundle();
+ }
+ @Override
+ protected Map<Locale, String>getValues() {
+ return wrapped.getValues();
+ }
+
+
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs