Class Messages

java.lang.Object
com.sun.tools.corba.ee.idl.som.cff.Messages

public abstract class Messages extends Object
This class provides messaging services for accessing, and merging parameters into, translatable message text. The text is presumed to reside in a .properties file. A "cff.properties" file that contains all of the message text needed for the CFF framework itself is loaded during class initialization. All of the messages in the cff.properties file that are needed by the CFF framework contain keys that begin with the string "cff.".

The static method Messages.msgLoad may be used to merge additional message text .properties files needed by other frameworks or user programs.

See Also:
  • Field Details

  • Constructor Details

    • Messages

      public Messages()
  • Method Details

    • loadDefaultProperties

      private static final void loadDefaultProperties()
    • fixMessages

      private static final void fixMessages(Properties p)
      This method was introduced to fix defect #26964. For Java 1.0.2 on Win NT, the escape sequence was not being handled correctly by the Java Properties class when it was the final character of a line. Instead the trailing blank was dropped and the next line was swallowed as a continuation. To work around the problem, we introduced our own metasymbol to represent a trailing blank. Hence: Performs substitution for any metasymbols in the message templates. So far only %B is needed. This was introduced to make it more convenient for .properties files to contain message templates with leading or trailing blanks (although %B may actually occur anywhere in a template). Subsequently, checking for '\n' has also been added. Now, wherever '\n' occurs in a message template, it is replaced with the value of System.getProperty ("line.separator").
    • msgLoad

      public static final void msgLoad(String propertyFileName) throws IOException
      Loads additional message keys and text found in the passed properties file. The specified properties file is assumed to reside in the CLASSPATH. An IOException is thrown if the loading fails.
      Parameters:
      propertyFileName - file name of properties file to load
      Throws:
      IOException
    • msg

      public static final String msg(String msgkey)
      Returns the message text corresponding to the passed msgkey string. If the msgkey cannot be found, its value is returned as the output message text.
      Parameters:
      msgkey - key of the message
      Returns:
      resulting message text
    • msg

      public static final String msg(String msgkey, String parm)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of a single argument, supplied by the "parm" parameter. If the message text does not contain the meta characters "%1" that indicate where to place the argument, the passed argument is appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

      Parameters:
      msgkey - message key
      parm - parameter for the message
      Returns:
      resulting message text
    • msg

      public static final String msg(String msgkey, int parm)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of a single argument, supplied by the "parm" parameter. If the message text does not contain the meta characters "%1" that indicate where to place the argument, the passed argument is appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • msg

      public static final String msg(String msgkey, String parm1, String parm2)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of two arguments, supplied by the "parm1" and "parm2" parameters. If the message text does not contain the meta characters "%1" and "%2" that indicate where to place the arguments, the passed arguments are appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • msg

      public static final String msg(String msgkey, int parm1, String parm2)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of two arguments, supplied by the "parm1" and "parm2" parameters. If the message text does not contain the meta characters "%1" and "%2" that indicate where to place the arguments, the passed arguments are appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • msg

      public static final String msg(String msgkey, String parm1, int parm2)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of two arguments, supplied by the "parm1" and "parm2" parameters. If the message text does not contain the meta characters "%1" and "%2" that indicate where to place the arguments, the passed arguments are appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • msg

      public static final String msg(String msgkey, int parm1, int parm2)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of two arguments, supplied by the "parm1" and "parm2" parameters. If the message text does not contain the meta characters "%1" and "%2" that indicate where to place the arguments, the passed arguments are appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • msg

      public static final String msg(String msgkey, String parm1, String parm2, String parm3)
      Returns the message text corresponding to the passed msgkey string. The message text is assumed to require the insertion of three arguments, supplied by the "parm1", "parm2" and "parm3" parameters. If the message text does not contain the meta characters "%1" and "%2" that indicate where to place the arguments, the passed arguments are appended at the end of the message text.

      If the msgkey cannot be found, its value is used as the message text.

    • substituteString

      private static String substituteString(String orig, int paramNum, String subst)