Package org.nuiton.jaxx.compiler
Class I18nHelper
- java.lang.Object
-
- org.nuiton.jaxx.compiler.I18nHelper
-
public class I18nHelper extends Object
I18n methods to addI18n.t(String, Object...)method on some attributes.Make sure to set an i18nable compiler to have his
CompilerConfiguration.isI18nable()returning true.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>I18N_ATTRIBUTESprotected static org.apache.logging.log4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description I18nHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringaddI18nInvocation(String widgetId, String attributeName, String attributeValueCode, JAXXCompiler compiler)Add the i18n on a attribute.static StringaddI18nMnemonicInvocation(CompiledObject object, String attributeName, String attributeValueCode, JAXXCompiler compiler)Box a i18n key with code to be used as a i18n mnemonic.static booleanisDoubleList(ClassDescriptor object)static booleanisI18nableAttribute(String attributeName, JAXXCompiler compiler)FIXME We should useJAXXEngine.getI18nProperty(ClassDescriptor)to obtain this value Test if we have an active i18n attribute (says an i18n attribute on a i18neable compiler).static booleanisI18nAttribute(String attributeName)FIXME We should useJAXXEngine.getI18nProperty(ClassDescriptor)to obtain this value Test if we have an i18n attribute.static voidtryToRegisterI18nInvocation(JAXXCompiler compiler, String code)
-
-
-
Method Detail
-
isI18nableAttribute
public static boolean isI18nableAttribute(String attributeName, JAXXCompiler compiler)
FIXME We should useJAXXEngine.getI18nProperty(ClassDescriptor)to obtain this value Test if we have an active i18n attribute (says an i18n attribute on a i18neable compiler).- Parameters:
attributeName- name of attribute to testcompiler- current used compiler (contains options)- Returns:
trueif wa have an active i18n attribute,falseotherwise.
-
isI18nAttribute
public static boolean isI18nAttribute(String attributeName)
FIXME We should useJAXXEngine.getI18nProperty(ClassDescriptor)to obtain this value Test if we have an i18n attribute.- Parameters:
attributeName- name of attribute to test- Returns:
trueif wa have an active i18n attribute,falseotherwise.
-
addI18nInvocation
public static String addI18nInvocation(String widgetId, String attributeName, String attributeValueCode, JAXXCompiler compiler)
Add the i18n on a attribute.Note: Be ware : no test is done here to ensure we are on a i18neable attribute for an i18nable compiler.
Make sure with the method
isI18nableAttribute(String, JAXXCompiler)returnstruebefore using this method.- Parameters:
widgetId- the id of the widgetattributeName- the name of the attributeattributeValueCode- the value code of the attribute valuecompiler- the current used compile- Returns:
- the surrender i18n call if attribute name is match the attributeValueCode otherwise
-
addI18nMnemonicInvocation
public static String addI18nMnemonicInvocation(CompiledObject object, String attributeName, String attributeValueCode, JAXXCompiler compiler)
Box a i18n key with code to be used as a i18n mnemonic.Note: Be ware : no test is done here to ensure we are on a i18neable attribute for an i18nable compiler.
- Parameters:
object- the object to useattributeName- the name of the attributeattributeValueCode- the value code of the attribute valuecompiler- the current used compile- Returns:
- the surrender i18n call if attribute name is match the attributeValueCode otherwise
- Since:
- 2.6.11
-
tryToRegisterI18nInvocation
public static void tryToRegisterI18nInvocation(JAXXCompiler compiler, String code)
-
isDoubleList
public static boolean isDoubleList(ClassDescriptor object)
-
-