org.olat.core.util
Class Util

java.lang.Object
  extended by org.olat.core.util.Util

public class Util
extends java.lang.Object

Description:

Author:
Felix Jost

Constructor Summary
Util()
           
 
Method Summary
static Translator createPackageTranslator(java.lang.Class baseClass, java.util.Locale locale)
           
static Translator createPackageTranslator(java.lang.Class baseClass, java.util.Locale locale, Translator fallback)
          returns a Translator for the given baseclass and locale
static java.lang.String getPackageName(java.lang.Class clazz)
          Deprecated. please use createPackageTranslator.... Returns the package name for this class
static java.lang.String getPackageVelocityRoot(java.lang.Class clazz)
          Converts the package name to the velocity root path by replacing .'s with /'s.
static java.lang.String getPackageVelocityRoot(java.lang.String packageName)
          Converts the package name to the velocity root path by replacing .'s with /'s.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getPackageName

public static java.lang.String getPackageName(java.lang.Class clazz)
Deprecated. please use createPackageTranslator.... Returns the package name for this class

Parameters:
clazz -
Returns:
the package name

getPackageVelocityRoot

public static java.lang.String getPackageVelocityRoot(java.lang.Class clazz)
Converts the package name to the velocity root path by replacing .'s with /'s. The prefix org will be stripped away. Use this to set velocity pages in a velocity container.

Parameters:
clazz -
Returns:
the velocity root path

getPackageVelocityRoot

public static java.lang.String getPackageVelocityRoot(java.lang.String packageName)
Converts the package name to the velocity root path by replacing .'s with /'s. The prefix org will be stripped away. Use this to set velocity pages in a velocity container.

Parameters:
packageName -
Returns:
the velocity root path

createPackageTranslator

public static Translator createPackageTranslator(java.lang.Class baseClass,
                                                 java.util.Locale locale)

createPackageTranslator

public static Translator createPackageTranslator(java.lang.Class baseClass,
                                                 java.util.Locale locale,
                                                 Translator fallback)
returns a Translator for the given baseclass and locale

Parameters:
baseClass - the location of the class will be taken to resolve the relative resource "_i18n/LocalStrings_(localehere).properties"
locale -
fallback - The fallback translator that should be used
Returns: