|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LocalizedContext
A helper object which allows to retrieve titles and descriptions for
resources implementing the Localized
interface. The
object performs language range matching as described in RFC2616 to determine
the best fitting language to use for display purposes.
The language ranges to be considered are determined by how the context object
is retrieved. For details, see
LocalizedContextHome
and its sub-interfaces.
The computation of the preferred locale will find the best match between the
ordered set of locales that LocalizedContext
was created on and the
locales passed in to the getPreferredLocale[s]
method. If
exactly one match is found it will be returned. If more than one equivalent
matches are found, then they will be returned in the same order as in the
input sequence. If no match is found: (a) if the LocalizedContext
sequence contains the root locale, then all locales from the input sequence
are returned. If (b) the LocalizedContext
does not contain the root
locale then the empty list will be returned.
PortletLocalizedContext
,
PortalLocalizedContextHome
,
PortletLocalizedContextHome
Method Summary | ||
---|---|---|
java.util.Locale |
getDefaultLocale()
Deprecated. use LocalizedContextHome.getDefaultLocale() instead |
|
java.lang.String |
getDescription(Localized aLocalized)
Deprecated. use getLocalizedDescription(Localized) instead |
|
java.util.Map.Entry<java.util.Locale,? extends java.util.Comparator<? super java.lang.String>> |
getLocalizedComparator()
Returns the comparator based on the current context |
|
java.util.Map.Entry<java.util.Locale,java.lang.String> |
getLocalizedDescription(Localized aLocalized)
Returns a fitting description of the given localized instance based on the information the context was created with. |
|
java.util.Map.Entry<java.util.Locale,java.lang.String> |
getLocalizedString(java.lang.String key,
java.util.ResourceBundle bundle)
Returns the localized translation for the string in a resource bundle |
|
java.util.Map.Entry<java.util.Locale,java.lang.String> |
getLocalizedTitle(Localized aLocalized)
Returns a fitting title of the given localized instance based on the information the context was created with. |
|
java.util.Locale |
getPreferredLocale(java.lang.Iterable<java.util.Locale> anIterable)
Returns a preferred locale based on the information the context was created with. |
|
java.util.Locale |
getPreferredLocale(IterableListModel<java.util.Locale> aLocaleList)
Returns a preferred locale based on the information the context was created with. |
|
java.util.Locale |
getPreferredLocale(java.util.Iterator<java.util.Locale> anIterator)
Returns a preferred locale based on the information the context was created with. |
|
java.util.Locale |
getPreferredLocale(ListModel<java.util.Locale> aLocaleList)
Returns a preferred locale based on the information the context was created with. |
|
java.util.List<java.util.Locale> |
getPreferredLocales(java.lang.Iterable<java.util.Locale> anIterable)
Returns a read-only list of preferred locales (in descending order) based on the information the context was created with. |
|
java.util.List<java.util.Locale> |
getPreferredLocales(IterableListModel<java.util.Locale> aLocaleList)
Returns a read-only list of preferred locales (in descending order) based on the information the context was created with. |
|
java.util.List<java.util.Locale> |
getPreferredLocales(java.util.Iterator<java.util.Locale> anIterator)
Returns a read-only list of preferred locales (in descending order) based on the information the context was created with. |
|
java.util.List<java.util.Locale> |
getPreferredLocales(ListModel<java.util.Locale> aLocaleList)
Returns a read-only list of preferred locales (in descending order) based on the information the context was created with. |
|
java.util.Locale |
getPreferredSupportedLocale()
Returns a preferred locale based on the information the context was created with. |
|
java.util.List<java.util.Locale> |
getPreferredSupportedLocales()
Returns a read-only list of preferred locales (in descending order) based on the information the context was created with. |
|
java.util.ResourceBundle |
getResourceBundle(java.lang.String baseName)
Gets a resource bundle using the specified base name based on the information the context was created with. |
|
java.util.ResourceBundle |
getResourceBundle(java.lang.String baseName,
java.lang.ClassLoader loader)
Gets a resource bundle using the specified base name based on the information the context was created with. |
|
IterableListModel<java.util.Locale> |
getSupportedLocales()
Deprecated. user LocalizedContextHome.getSupportedLocales()
instead |
|
java.lang.String |
getTitle(Localized aLocalized)
Deprecated. use getLocalizedTitle(Localized) instead |
|
java.util.Iterator<java.util.Locale> |
iterator()
Returns an iterator over all locales that this context is based on. |
|
|
sort(java.util.Iterator<? extends T> aList)
Sorts a sequence of localized objects. |
|
|
sort(java.util.Iterator<? extends T> aList,
LocalizedContextHome.ComparatorFactory aCmp)
Sorts a sequence of localized objects. |
|
java.util.Locale[] |
toArray()
Returns the ordered list of locales that this context is based on as an array |
Method Detail |
---|
@Deprecated java.util.Locale getDefaultLocale()
LocalizedContextHome.getDefaultLocale()
instead
null
@Deprecated java.lang.String getDescription(Localized aLocalized)
getLocalizedDescription(Localized)
instead
aLocalized
- the localized providing the titles to choose from, not
null
null
, but may be an empty
stringjava.util.Map.Entry<java.util.Locale,? extends java.util.Comparator<? super java.lang.String>> getLocalizedComparator()
null
if no comparator could be
determinedjava.util.Map.Entry<java.util.Locale,java.lang.String> getLocalizedDescription(Localized aLocalized)
aLocalized
- the localized providing the titles to choose from, not
null
null
. Neither key nor
value are null
, but the value may be an empty stringjava.util.Map.Entry<java.util.Locale,java.lang.String> getLocalizedString(java.lang.String key, java.util.ResourceBundle bundle)
key
- key in the bundlebundle
- the bundle
null
if none existsjava.util.Map.Entry<java.util.Locale,java.lang.String> getLocalizedTitle(Localized aLocalized)
aLocalized
- the localized providing the titles to choose from, not
null
null
. Neither key nor value are
null
, but the value may be an empty stringjava.util.Locale getPreferredLocale(java.lang.Iterable<java.util.Locale> anIterable)
anIterable
- providing the input locales to choose from, not
null
. The order of locales in the iterator is not
relevant.
null
.
In case of ambiguous matches, the locale that came first in the
input iterator will be used.java.util.Locale getPreferredLocale(IterableListModel<java.util.Locale> aLocaleList)
aLocaleList
- providing the input locales to choose from, not
null
null
.
In case of ambiguous matches, the locale that came first in the
input iterator will be used.java.util.Locale getPreferredLocale(java.util.Iterator<java.util.Locale> anIterator)
anIterator
- providing the input locales to choose from, not
null
.
null
.
In case of ambiguous matches, the locale that came first in the
input iterator will be used.java.util.Locale getPreferredLocale(ListModel<java.util.Locale> aLocaleList)
aLocaleList
- providing the input locales to choose from, not
null
null
.
In case of ambiguous matches, the locale that came first in the
input iterator will be used.java.util.List<java.util.Locale> getPreferredLocales(java.lang.Iterable<java.util.Locale> anIterable)
anIterable
- providing the input locales to choose from, not
null
. The order of locales in the iterator is not
relevant.
null
, but may
be empty. In case of ambiguous matches, the locale order of the
input list is kept.java.util.List<java.util.Locale> getPreferredLocales(IterableListModel<java.util.Locale> aLocaleList)
aLocaleList
- providing the input locales to choose from, not
null
null
, but may
be empty. In case of ambiguous matches, the locale order of the
input list is kept.java.util.List<java.util.Locale> getPreferredLocales(java.util.Iterator<java.util.Locale> anIterator)
anIterator
- providing the input locales to choose from, not
null
. The order of locales in the iterator is not
relevant.
null
, but may
be empty. In case of ambiguous matches, the locale order of the
input list is kept.java.util.List<java.util.Locale> getPreferredLocales(ListModel<java.util.Locale> aLocaleList)
aLocaleList
- providing the input locales to choose from, not
null
null
, but may
be empty. In case of ambiguous matches, the locale order of the
input list is kept.java.util.Locale getPreferredSupportedLocale()
null
.
In case of ambiguous matches, the locale that came first in the
input iterator will be used.java.util.List<java.util.Locale> getPreferredSupportedLocales()
null
, but may
be empty. In case of ambiguous matches, the locale order of the
supported locales list is kept.java.util.ResourceBundle getResourceBundle(java.lang.String baseName)
baseName
- the base name of the resource bundle, a fully qualified class
name
java.util.MissingResourceException
- if no resource bundle for the specified base name can be
foundjava.util.ResourceBundle getResourceBundle(java.lang.String baseName, java.lang.ClassLoader loader)
baseName
- the base name of the resource bundle, a fully qualified class
nameloader
- the class loader from which to load the resource bundle
java.util.MissingResourceException
- if no resource bundle for the specified base name can be
found@Deprecated IterableListModel<java.util.Locale> getSupportedLocales()
LocalizedContextHome.getSupportedLocales()
instead
getSupportedLocales
in interface LocaleCapable
@Deprecated java.lang.String getTitle(Localized aLocalized)
getLocalizedTitle(Localized)
instead
aLocalized
- the localized providing the titles to choose from, not
null
null
, but may be an empty stringjava.util.Iterator<java.util.Locale> iterator()
iterator
in interface java.lang.Iterable<java.util.Locale>
iterator
in interface IterableListModel<java.util.Locale>
iterator
in interface ListModel<java.util.Locale>
null
<T extends Localized> SortedLocalized<? extends T> sort(java.util.Iterator<? extends T> aList)
aList
- the sequence of objects to sort, not null
null
<T extends Localized> SortedLocalized<? extends T> sort(java.util.Iterator<? extends T> aList, LocalizedContextHome.ComparatorFactory aCmp)
aList
- the sequence of objects to sort, not null
aCmp
- the factory that generates comparators per locale, not
null
null
LocalizedContextHome.getDefaultCollators()
java.util.Locale[] toArray()
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |