hudson.plugins.findbugs
Class FindBugsMessages

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

public final class FindBugsMessages
extends java.lang.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.
 java.lang.String getMessage(java.lang.String name, java.util.Locale locale)
          Returns a HTML description for the specified bug.
 java.lang.String getShortMessage(java.lang.String name, java.util.Locale locale)
          Returns a short description for the specified bug.
 void initialize()
          Initializes the messages map.
 java.util.List<Pattern> parse(java.io.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 java.io.IOException,
                       org.xml.sax.SAXException
Initializes the messages map.

Throws:
org.xml.sax.SAXException - if we can't parse a file
java.io.IOException - if we can't read a file

parse

public java.util.List<Pattern> parse(java.io.InputStream file)
                              throws java.io.IOException,
                                     org.xml.sax.SAXException
Parses the FindBugs pattern description.

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

getMessage

public java.lang.String getMessage(java.lang.String name,
                                   java.util.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 descripgeka

getShortMessage

public java.lang.String getShortMessage(java.lang.String name,
                                        java.util.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 © 2009. All Rights Reserved.