|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.alfresco.service.cmr.repository.MLText
public class MLText
Class to represent a multilingual (ML) text value.
The language codes used should conform to the ISO639-2 language code standard, although there is no enforcement of the standard in this class.
This is a simple extension of a HashMap with a few convenience methods.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry, java.util.AbstractMap.SimpleImmutableEntry |
| Constructor Summary | |
|---|---|
MLText()
|
|
MLText(java.util.Locale locale,
java.lang.String value)
Construct an instance with a value for the given locale. |
|
MLText(java.lang.String value)
Construct an instance with a value corresponding to the current context locale. |
|
| Method Summary | |
|---|---|
void |
addValue(java.util.Locale locale,
java.lang.String value)
Add a multilingual text value |
java.lang.String |
getClosestValue(java.util.Locale locale)
The given locale is used to search for a matching value according to: An exact locale match A match of locale ISO language codes The value for the locale provided in the constructor
An arbitrary value
null
|
java.lang.String |
getDefaultValue()
Retrieves a default value from the set of available locales. |
java.util.Set |
getLocales()
|
java.lang.String |
getValue(java.util.Locale locale)
Retrieve a multilingual text value |
java.util.Collection |
getValues()
|
void |
removeValue(java.util.Locale locale)
Remove a multilingual text value |
| Methods inherited from class java.util.HashMap |
|---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public MLText()
public MLText(java.lang.String value)
value - the value for the current default localeI18NUtil.getLocale(),
MLText.MLText(Locale, String),
MLText.getDefaultValue()
public MLText(java.util.Locale locale,
java.lang.String value)
locale - the localevalue - the valueMLText.getDefaultValue()| Method Detail |
|---|
public java.util.Set getLocales()
public java.util.Collection getValues()
public void addValue(java.util.Locale locale,
java.lang.String value)
locale - the language localevalue - the multilingual textpublic java.lang.String getValue(java.util.Locale locale)
locale - the language localepublic java.lang.String getDefaultValue()
I18NUtil.getLocale(),
MLText.getClosestValue(Locale)public java.lang.String getClosestValue(java.util.Locale locale)
constructor
locale - the locale to use as the starting point of the value search
public void removeValue(java.util.Locale locale)
locale - the language locale
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||