You can use the doclet
multex.tool.ExceptionMessagesDoclet
to collect
all exception message text patterns from the exceptions. You must
specify the sources to scan as usually for a doclet. You must pass the
output .properties
file name to the doclet option
-out
.
By executing the doclet on the upper examples the following
property definitions will be appended to the given
-out
file:
org.company.project.Account$CreditLimitExc = Taking {0} units from your ac\ count will leave less than your creditLimit {1} units on it. org.company.project.FileUtil$LoadFileFailure = Failure loading file {0} by user {1}
As Javadoc removes white space at the end of each comment line, and java.util.Properties.load ignores the \ indicating line continuation and whitespace at the beginning of the next line, it is somehow difficult to make continuation lines with an intuitive spacing. You can either split the long message text inside of a word, as e.g. the word account in the example was split, or you can insert a Properties escape sequence for whitespace at the end of the line, e.g. a \t or a \u0020.