Package edu.umd.cs.findbugs
Class I18N
- java.lang.Object
-
- edu.umd.cs.findbugs.I18N
-
public class I18N extends java.lang.Object
Singleton responsible for returning localized strings for information returned to the user.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ResourceBundle
annotationDescriptionBundle
private static boolean
DEBUG
static java.util.Locale
defaultLocale
private java.util.ResourceBundle
englishAnnotationDescriptionBundle
used if local one can't be foundprivate static I18N
theInstance
-
Constructor Summary
Constructors Constructor Description I18N()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getAnnotationDescription(java.lang.String key)
Get an annotation description string.java.lang.String
getBugCategoryDescription(java.lang.String category)
Get the description of a bug category.java.lang.String
getBugTypeDescription(java.lang.String shortBugType)
Get a description for given "bug type".java.lang.String
getDetailHTML(java.lang.String key)
Get an HTML document describing the bug pattern for given key in detail.java.lang.String
getMessage(java.lang.String key)
Deprecated.java.lang.String
getShortMessage(java.lang.String key)
Get a short message string.java.lang.String
getShortMessageWithoutCode(java.lang.String key)
static I18N
instance()
Get the single object instance.
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
-
defaultLocale
public static final java.util.Locale defaultLocale
-
annotationDescriptionBundle
private final java.util.ResourceBundle annotationDescriptionBundle
-
englishAnnotationDescriptionBundle
private final java.util.ResourceBundle englishAnnotationDescriptionBundle
used if local one can't be found
-
theInstance
private static I18N theInstance
-
-
Method Detail
-
instance
public static I18N instance()
Get the single object instance.
-
getMessage
@Deprecated @Nonnull public java.lang.String getMessage(java.lang.String key)
Deprecated.Get a message string. This is a format pattern for describing an entire bug instance in a single line.- Parameters:
key
- which message to retrieve
-
getShortMessage
@Nonnull public java.lang.String getShortMessage(java.lang.String key)
Get a short message string. This is a concrete string (not a format pattern) which briefly describes the type of bug, without mentioning particular a particular class/method/field.- Parameters:
key
- which short message to retrieve
-
getShortMessageWithoutCode
@Nonnull public java.lang.String getShortMessageWithoutCode(java.lang.String key)
-
getDetailHTML
@Nonnull public java.lang.String getDetailHTML(java.lang.String key)
Get an HTML document describing the bug pattern for given key in detail.- Parameters:
key
- which HTML details for retrieve
-
getAnnotationDescription
public java.lang.String getAnnotationDescription(java.lang.String key)
Get an annotation description string. This is a format pattern which will describe a BugAnnotation in the context of a particular bug instance. Its single format argument is the BugAnnotation.- Parameters:
key
- the annotation description to retrieve
-
getBugTypeDescription
@Nonnull public java.lang.String getBugTypeDescription(java.lang.String shortBugType)
Get a description for given "bug type". FIXME: this is referred to elsewhere as the "bug code" or "bug abbrev". Should make the terminology consistent everywhere. In this case, the bug type refers to the short prefix code prepended to the long and short bug messages.- Parameters:
shortBugType
- the short bug type code- Returns:
- the description of that short bug type code means
-
getBugCategoryDescription
public java.lang.String getBugCategoryDescription(java.lang.String category)
Get the description of a bug category. Returns the category if no description can be found.- Parameters:
category
- the category- Returns:
- the description of the category
-
-