Class BasicUtility


  • public class BasicUtility
    extends Object
    Basic utilities needed by the 'ApplyModule' module class. Before the 'ant apply.module' target is run a mini compilation is done to compile all classes needed by that code (and not more). This BasicUtility class was split out of the main 'Utility' class to not pull in the big chain of transitive compile-time dependencies into ApplyModule. Nothing should be added here without reviewing the list of files compiled by the 'ant compile.apply.module' target to check that it did not grow.
    • Constructor Detail

      • BasicUtility

        public BasicUtility()
    • Method Detail

      • messageBD

        public static String messageBD​(ConnectionProvider conn,
                                       String strCode,
                                       String strLanguage,
                                       boolean escape)
        Translate the given code into some message from the application dictionary.
        Parameters:
        conn - Handler for the database connection.
        strCode - String with the code to search.
        strLanguage - String with the translation language.
        escape - Escape \n and " characters
        Returns:
        String with the translated message.
      • formatMessageBDToHtml

        public static String formatMessageBDToHtml​(String message)
        Formats a message String into a String for html presentation. Escapes the &, <, >, " and ®, and replace the \n by <br/> and \r for space. IMPORTANT! : this method is designed to transform the output of Utility.messageBD method, and this method replaces \n by \\n and \" by &quote. Because of that, the first replacements revert this previous replacements.
        Parameters:
        message - message with java formating
        Returns:
        html format message