'how to categorize strings based on their categories

I have a '.java' class of Enums which represent Error Messages with an Error Code. Which looks like this:

   /**
    * Description of the Error Message.
    * @type exception
    * @category MyCategory2
    */
   ERR_001,

   /**
    * Description of the Error Message.
    * 
    * @type contextmessage
    * @category MyCategory4
    * @category MyCategory2
    */
   ERR_002,

Then I created an html table filled with the 3 values (Error Code, Error Message, Description) which looks like this:

html table of Errors

I outputted the 3 Values into the table like this:

tbody {
    output.each { row ->
     tr {
        td(row.name)
        td(row.template)
        td(row.commentText)
 }

My 2 Problems:

  1. I don't want the entire Description to be shown (with the associated @type and @category) maybe there is a way to shorten the string to the '.' character.
  2. How could I go on and output the Error Codes sorted by their Category


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source