Package com.jalios.util
Interface LangPropertyArgument
- 
- All Known Implementing Classes:
 AbstractCalendarEvent,AbstractDBTestType,AbstractEventResource,AbstractJPortal,AbstractMedia,AbstractPortalJspCollection,AbstractShortcut,AbstractTestType,AbstractWebPage,AccessControlList,Alert,AuthenticationCookie,Category,CategoryRight,Content,Data,DataExtension,DataRight,DBFileDocument,DBMember,FileDocument,FileProcessingInfo,FileProcessingLog,Form,Group,JPortalStructure,LoginEvent,MailMessage,MediaProgression,Member,MemberDeleteRequest,MemberPreference,Notification,NotificationCriteria,Portal,PortalElement,PortalRedirect,Portlet,PortletCollection,PortletParent,PortletSkinable,Publication,PublicationFollower,PublicDownload,PublicLink,ReaderTracker,Recommendation,StrongLock,UserContent,Vote,WFNote,WKRole,Workspace,WSTypeEntry
public interface LangPropertyArgumentInterface to be implemented to provide I18N of objects in language properties.LangProperties properties = new LangProperties(); properties.put("en.i18n-object", "In English : {0} {1}"); properties.put("fr.i18n-object", "En Français : {0} {1}"); Object objectI18N = new LangPropertyArgument() { public String getLangPropertyValue(String language) { return language.equals("en") ? "Product" : "Produit"; } }; Object objectNotI18N = new Object() { @Override public String toString() { return String.valueOf(42); } }; // - objects which DO NOT implement the LangPropertyArgument uses toString method // - objects which DO implement the LangPropertyArgument uses getLangPropertyName method LangProperty property = new LangProperty("i18n-object", objectI18N, objectNotI18N); assertEquals("In English : Product 42", properties.getExplicitLangProperty(property, "en")); assertEquals("En Français : Produit 42", properties.getExplicitLangProperty(property, "fr")); 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetLangPropertyValue(java.lang.String language)Retrieve the string value of this object in the specified language, when being used inside a language property. 
 - 
 
- 
- 
Method Detail
- 
getLangPropertyValue
java.lang.String getLangPropertyValue(java.lang.String language)
Retrieve the string value of this object in the specified language, when being used inside a language property.- Parameters:
 language- the ISO-639 language code to be used to retrieve the localized Object's name- Returns:
 - this object as a string value in the specified language
 
 
 - 
 
 -