Package org.jboss.logging.processor.util
Class TranslationHelper
- java.lang.Object
-
- org.jboss.logging.processor.util.TranslationHelper
-
public final class TranslationHelper extends java.lang.Object
Utility class to work with translation filename.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
TRANSLATION_FILE_NAME_EXTENSION
-
Constructor Summary
Constructors Modifier Constructor Description private
TranslationHelper()
Private constructor to disable instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getEnclosingTranslationClassName(java.lang.String translationClassName)
Returns the enclosing translation class name for the given translation class name.static java.lang.String
getEnclosingTranslationFileName(java.io.File translationFile)
Returns the enclosing translation file name for the given translation file name.static java.lang.String
getTranslationClassNameSuffix(java.lang.String translationFileName)
Get the class name suffix to be added to the generated class for the given translation file name.
-
-
-
Field Detail
-
TRANSLATION_FILE_NAME_EXTENSION
private static final java.lang.String TRANSLATION_FILE_NAME_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTranslationClassNameSuffix
public static java.lang.String getTranslationClassNameSuffix(java.lang.String translationFileName)
Get the class name suffix to be added to the generated class for the given translation file name.- Parameters:
translationFileName
- the translation file name- Returns:
- the class name suffix corresponding to the given translation filename
- Throws:
java.lang.IllegalArgumentException
- if translationFileName is null or not valid
-
getEnclosingTranslationFileName
public static java.lang.String getEnclosingTranslationFileName(java.io.File translationFile)
Returns the enclosing translation file name for the given translation file name. If the given translation file name is InterfaceName.i18n_locale the given translation file name is returned.- Parameters:
translationFile
- the translation file- Returns:
- the enclosing file name
- Throws:
java.lang.IllegalArgumentException
- if translationFileName is null
-
getEnclosingTranslationClassName
public static java.lang.String getEnclosingTranslationClassName(java.lang.String translationClassName)
Returns the enclosing translation class name for the given translation class name. If the given translation class name is the upper class name then the parameter class name is returned.- Parameters:
translationClassName
- the translation class name- Returns:
- the enclosing class name
- Throws:
java.lang.IllegalArgumentException
- if translationClassName is null
-
-