Class ErrorMsgLib


  • public class ErrorMsgLib
    extends java.lang.Object
    Library of error-message localization functions. Errors autogenerated by a Visual Basic program that reads them from the main error database for Castor COM, GUI, and Kernel.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorMsgLib()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int convertJavaLocaleToLCID​(java.util.Locale jLocale)
      Converts a Java Locale to a Windows-based Locale ID.
      static java.util.Locale convertLCIDToJavaLocale​(int localeID)
      Converts a Windows-based Locale ID to a Java Locale.
      static void dispenseWebAPIErrors​(java.lang.String destinationDir, java.lang.String packagePath)
      Dispenses all localized WebAPIErrors property files to specified destination directory.
      static java.lang.String getAndFormatString​(int errorCode)
      This function gets the error string that the error code passed in refers to, using the default locale.
      static java.lang.String getAndFormatString​(int errorCode, java.lang.String[] argList)
      This function gets the error string that the error code passed in refers to, using the default locale for the JVM.
      static java.lang.String getAndFormatString​(java.util.Locale locale, int errorCode)
      This function gets the error string that the error code passed in refers to, using the Locale that is passed in.
      static java.lang.String getAndFormatString​(java.util.Locale locale, int errorCode, java.lang.String baseName)
      This function gets the error string that the error code passed in refers to, using the Locale that is passed in and the class path of the base name.
      static java.lang.String getAndFormatString​(java.util.Locale locale, int errorCode, java.lang.String[] argList)
      This function gets the error string that the error code passed in refers to, using the Locale that is passed in.
      static java.lang.String getAndFormatString​(java.util.Locale locale, int errorCode, java.lang.String baseName, java.lang.String[] argList)
      This function gets the error string that the error code passed in refers to, using the Locale and the base name that is passed in.
      static int getJarMarkIndex​(int startIndex, java.lang.String path)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorMsgLib

        public ErrorMsgLib()
    • Method Detail

      • convertLCIDToJavaLocale

        public static java.util.Locale convertLCIDToJavaLocale​(int localeID)
        Converts a Windows-based Locale ID to a Java Locale. Converted by hand. Note that some of the extremely obscure, unsupported(in windows) countries are not added yet. Most of these languages are not supported by MSTR products directly, but their presence won't hurt anything, and will reduce the maintenance on this file.
        Parameters:
        localeID - int
        Returns:
        java.util.Locale
      • convertJavaLocaleToLCID

        public static int convertJavaLocaleToLCID​(java.util.Locale jLocale)
        Converts a Java Locale to a Windows-based Locale ID. Converted by hand.
        Parameters:
        jLocale - java.util.Locale
        Returns:
        int
      • getAndFormatString

        public static java.lang.String getAndFormatString​(int errorCode)
        This function gets the error string that the error code passed in refers to, using the default locale. Will not substitute for any {0} parameters in the String.
        Parameters:
        errorCode - int
        Returns:
        java.lang.String
      • getAndFormatString

        public static java.lang.String getAndFormatString​(int errorCode,
                                                          java.lang.String[] argList)
        This function gets the error string that the error code passed in refers to, using the default locale for the JVM. It then substitutes values in the argList array for {0}, {1}, etc in the error string.
        Parameters:
        errorCode - int
        argList - String[]
        Returns:
        java.lang.String
      • getAndFormatString

        public static java.lang.String getAndFormatString​(java.util.Locale locale,
                                                          int errorCode)
        This function gets the error string that the error code passed in refers to, using the Locale that is passed in. This method will lookup the WebAPIErrors properties file first from the dispensed path, then if not found, from com.microstrategy.utils.localization.
        Parameters:
        locale - java.lang.String
        errorCode - int
        Returns:
        java.lang.String
      • getAndFormatString

        public static java.lang.String getAndFormatString​(java.util.Locale locale,
                                                          int errorCode,
                                                          java.lang.String[] argList)
        This function gets the error string that the error code passed in refers to, using the Locale that is passed in. It then substitutes all occurences of {0}, {1}, etc in the string with the values in argList.
        Parameters:
        locale - java.lang.String
        errorCode - int
        argList - java.lang.String[]
        Returns:
        java.lang.String
      • getAndFormatString

        public static java.lang.String getAndFormatString​(java.util.Locale locale,
                                                          int errorCode,
                                                          java.lang.String baseName)
        This function gets the error string that the error code passed in refers to, using the Locale that is passed in and the class path of the base name.
        Parameters:
        locale - java.lang.String
        errorCode - int
        baseName - java.lang.String
        Returns:
        java.lang.String
      • getAndFormatString

        public static java.lang.String getAndFormatString​(java.util.Locale locale,
                                                          int errorCode,
                                                          java.lang.String baseName,
                                                          java.lang.String[] argList)
        This function gets the error string that the error code passed in refers to, using the Locale and the base name that is passed in. It then substitutes all occurences of {0}, {1}, etc in the string with the values in argList.
        Parameters:
        locale - java.lang.String
        errorCode - int
        baseName - java.lang.String
        argList - java.lang.String[]
        Returns:
        java.lang.String
      • dispenseWebAPIErrors

        public static void dispenseWebAPIErrors​(java.lang.String destinationDir,
                                                java.lang.String packagePath)
        Dispenses all localized WebAPIErrors property files to specified destination directory. This directory must be inside the classpath.
        Parameters:
        destinationDir - destination directory for dispensing
        packagePath - dot notation package path to resource
        Since:
        MicroStrategy Web 8.0.1
      • getJarMarkIndex

        public static int getJarMarkIndex​(int startIndex,
                                          java.lang.String path)
        Since:
        MicroStrategy Web 8.0.1