com.ibm.mashups.enabler
Interface Localized


public Localized

Read-Only interface providing methods to obtain title and description of a resource. Please note that title or description are only returned if they are available in the requested locale. No fallback for locales is performed.


Method Summary
 String[] getLocales()
           Returns an array containing the locales that are supported by this object.
 String getTitle(String locale)
           Returns the title of this object in the given locale.
 Object getTitles()
           Returns the titles of this object in a map (key: locale, value: title).
 String getDescription(String locale)
           Returns the description of this object in the given locale.
 Object getDescriptions(String locale)
           Returns the descriptions of this object in a map (key: locale, value: description).
 

Method Detail

getLocales

String[] getLocales()
Returns an array containing the locales that are supported by this object. The presence of a locale in this list does not mean that a title and description is available, but rather that either one or both are available in that locale.

Note: Modifying the array does not change the supported locales.

Returns:
a list of locales defined for this object, returns an empty array if no locales are supported. Can never be null.

getTitle

String getTitle(String locale)
Returns the title of this object in the given locale.

Parameters:
locale - the locale for which to retrieve the title, must not be null.
Returns:
the title of this node in the given locale. If a title is not available in the given locale, this method will return null. It is up to the invoker of the method to implement an appropriate fallback mechanism.

getTitles

Object getTitles()
Returns the titles of this object in a map (key: locale, value: title).

Parameters:
locale - (optional) the locale for which to retrieve the titles, can be null. If locale is null/omitted, all are returned.
Returns:
the titles of this node in a locale<->title map. If a locale was given, the result will be a map containing only those locales with country specific matches (e.g. if you give a locale "pt", you might also get brazilian portugese ("pt-BR") - if you give a locale "zh-TW", you won't get "zh"). If there are no titles (matching the given locale), an empty object will be returned.
Since:
3.0

getDescription

String getDescription(String locale)
Returns the description of this object in the given locale.

Parameters:
locale - the locale for which to retrieve the description, must not be null.
Returns:
the description of this node in the given locale. If a description is not available in the given locale, this method will return null. It is up to the invoker of the method to implement an appropriate fallback mechanism.

getDescriptions

Object getDescriptions(String locale)
Returns the descriptions of this object in a map (key: locale, value: description).

Parameters:
locale - (optional) the locale for which to retrieve the descriptions, can be null. If locale is null/omitted, all are returned.
Returns:
the descriptions of this node in a locale<->description map. If a locale was given, the result will be a map containing only those locales with country specific matches (e.g. if you give a locale "pt", you might also get brazilian portugese ("pt-BR") - if you give a locale "zh-TW", you won't get "zh"). If there are no descriptions (matching the given locale), an empty object will be returned.
Since:
3.0


Copyright IBM Corp. 2010 All Rights Reserved.