org.mmbase.util
Class WrappedLocalizedString

java.lang.Object
  extended by org.mmbase.util.LocalizedString
      extended by org.mmbase.util.WrappedLocalizedString
All Implemented Interfaces:
Serializable, Cloneable, PublicCloneable<LocalizedString>
Direct Known Subclasses:
ReadonlyLocalizedString, ReplacingLocalizedString

public abstract class WrappedLocalizedString
extends LocalizedString

Extends and wraps LocalizedString.

Since:
MMBase-1.9
Version:
$Id: WrappedLocalizedString.java 41036 2010-02-15 22:30:54Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected  LocalizedString wrapped
           
 
Constructor Summary
protected WrappedLocalizedString(LocalizedString s)
           
 
Method Summary
 Map<Locale,String> asMap()
          Returns a Map representation of the localisation setting represented by this LocalizedString.
 boolean equals(Object o)
           
 String get(Locale locale)
          Gets the value for a certain locale.
protected  String getBundle()
           
 String getKey()
          Gets the key to use as a default and/or for obtaining a value from the bundle
 ReadonlyLocalizedString getReadonlyLocalizedString()
           
protected  Map<Locale,String> getValues()
           
 int hashCode()
           
 void set(String value, Locale locale)
          Sets the value for a certain locale.
 void setBundle(String b)
          A resource-bundle with given name can be associated to this LocalizedString.
 void setKey(String key)
          Sets the key to use as a default and/or for obtaining a value from the bundle
 
Methods inherited from class org.mmbase.util.LocalizedString
clone, degrade, degrade, fillFromXml, getDebugString, getDefault, getLocale, getLocale, getXmlLang, setDefault, setXmlLang, toString, toStrings, toXml
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

wrapped

protected final LocalizedString wrapped
Constructor Detail

WrappedLocalizedString

protected WrappedLocalizedString(LocalizedString s)
Parameters:
s - The wrapped LocalizedString.
Method Detail

getKey

public String getKey()
Description copied from class: LocalizedString
Gets the key to use as a default and/or for obtaining a value from the bundle

Overrides:
getKey in class LocalizedString

setKey

public void setKey(String key)
Description copied from class: LocalizedString
Sets the key to use as a default and/or for obtaining a value from the bundle

Overrides:
setKey in class LocalizedString

get

public String get(Locale locale)
Description copied from class: LocalizedString
Gets the value for a certain locale. If no match is found, it falls back to the key.

Overrides:
get in class LocalizedString

set

public void set(String value,
                Locale locale)
Description copied from class: LocalizedString
Sets the value for a certain locale. If the value for a more general locale is still unset, it will also set that (so, it sets also nl when setting nl_BE if nl still is unset).

Overrides:
set in class LocalizedString

asMap

public Map<Locale,String> asMap()
Description copied from class: LocalizedString
Returns a Map representation of the localisation setting represented by this LocalizedString. It is an unmodifiable mapping: Locale -> localized value.

Overrides:
asMap in class LocalizedString

setBundle

public void setBundle(String b)
Description copied from class: LocalizedString
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, using the key.

Overrides:
setBundle in class LocalizedString

getBundle

protected String getBundle()
Overrides:
getBundle in class LocalizedString

getValues

protected Map<Locale,String> getValues()
Overrides:
getValues in class LocalizedString

equals

public boolean equals(Object o)
Overrides:
equals in class LocalizedString

hashCode

public int hashCode()
Overrides:
hashCode in class LocalizedString

getReadonlyLocalizedString

public ReadonlyLocalizedString getReadonlyLocalizedString()
Overrides:
getReadonlyLocalizedString in class LocalizedString


MMBase 2.0-SNAPSHOT - null