Package de.xima.fc.form.common
Class XItemPropertyI18NUtils
- java.lang.Object
- 
- de.xima.fc.form.common.XItemPropertyI18NUtils
 
- 
 public class XItemPropertyI18NUtils extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description XItemPropertyI18NUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetBestLanguage(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject object, String propName)Given a language, searches for the closest language with an available translation for the given form element property.static StringgetI18NValue(XItem xitem, IXFormRenderConfig config, XPropertyEnum xProperty)static StringgetI18NValue(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property)static StringgetI18NValueR(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property)static StringgetI18NValueR(IXFormRenderConfig config, XPropertyEnum property, String defaultValue, XItemRenderData properties)static StringgetI18NValueR(IXFormRenderConfig config, String property, String defaultValue, XItemRenderData properties)static StringreplaceI18NAndEmptyValue(String value, IXFormRenderConfig config)
 
- 
- 
- 
Method Detail- 
replaceI18NAndEmptyValuepublic static String replaceI18NAndEmptyValue(String value, IXFormRenderConfig config) 
 - 
getBestLanguagepublic static String getBestLanguage(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject object, String propName) Given a language, searches for the closest language with an available translation for the given form element property. For example, if the form is to be rendered in the languagefr-CA, this method first checks whether a translation is available for that language. If so, that language is returned. Otherwise, this method checks whether a translation is available for the language tagfr. If none is available either, the empty string is returned.- Parameters:
- config- A form configuration with a language tag.
- object- A JSON object with the language tag as the key and another JSON object as the value. These JSON objects have the property name as the key and the localized text as the value.
- propName- Name of the (form element) property for which to find the localized text.
- Returns:
- The current language of the given form if a translation exists for that language, or a fallback language that has a translation.
 
 - 
getI18NValueRpublic static String getI18NValueR(IXFormRenderConfig config, XPropertyEnum property, String defaultValue, XItemRenderData properties) 
 - 
getI18NValueRpublic static String getI18NValueR(IXFormRenderConfig config, String property, String defaultValue, XItemRenderData properties) 
 - 
getI18NValueRpublic static String getI18NValueR(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property) 
 - 
getI18NValuepublic static String getI18NValue(XItem xitem, IXFormRenderConfig config, XPropertyEnum xProperty) 
 - 
getI18NValuepublic static String getI18NValue(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property) 
 
- 
 
-