hudson.plugins.findbugs
Class FindBugsMessages

java.lang.Object
  extended by hudson.plugins.findbugs.FindBugsMessages

public final class FindBugsMessages
extends Object

Parses the FindBugs pattern descriptions and provides access to these HTML messages.

Author:
Ulli Hafner

Method Summary
static FindBugsMessages getInstance()
          Returns the singleton instance.
 String getMessage(String name, Locale locale)
          Returns a HTML description for the specified bug.
 String getShortMessage(String name, Locale locale)
          Returns a short description for the specified bug.
 void initialize()
          Initializes the messages map.
 List<Pattern> parse(InputStream file)
          Parses the FindBugs pattern description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FindBugsMessages getInstance()
Returns the singleton instance.

Returns:
the singleton instance

initialize

public void initialize()
                throws IOException,
                       SAXException
Initializes the messages map.

Throws:
SAXException - if we can't parse a file
IOException - if we can't read a file

parse

public List<Pattern> parse(InputStream file)
                    throws IOException,
                           SAXException
Parses the FindBugs pattern description.

Parameters:
file - XML file with the messages
Returns:
a list of parsed patterns
Throws:
SAXException - if we can't parse the file
IOException - if we can't read the file

getMessage

public String getMessage(String name,
                         Locale locale)
Returns a HTML description for the specified bug.

Parameters:
name - name of the bug
locale - the locale of the user
Returns:
a HTML description

getShortMessage

public String getShortMessage(String name,
                              Locale locale)
Returns a short description for the specified bug.

Parameters:
name - name of the bug
locale - the locale of the user
Returns:
a HTML description for the specified bug.


Copyright © 2004-2012 Hudson. All Rights Reserved.