Class ProjectFilterSettings
java.lang.Object
edu.umd.cs.findbugs.config.ProjectFilterSettings
- All Implemented Interfaces:
Cloneable
Settings for user filtering of warnings for a project. This includes
selecting particular bug categories to view, as well as a minimum warning
priority. Includes support for encoding these settings as a String, which can
easily be stored as a persistent project property in Eclipse.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intstatic final StringDefault warning threshold priority.private booleanstatic final StringText string for experimental priority.private static final charThe character used for delimiting whole fields in filter settings encoded as stringsstatic final StringText string for high priority.private static final StringThe character used for delimiting list items in filter settings encoded as stringsstatic final StringText string for low priority.static final StringText string for medium priority.private Stringprivate intprivate intMap of priority level names to their numeric values. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCategory(String category) Add a bug category to the set of categories to be displayed.voidClear all bug categories from the hidden list.clone()booleancontainsCategory(String category) Returns false if the given category is hidden in the project filter settings.static ProjectFilterSettingsFactory method to create a default ProjectFilterSettings object.booleanGet whether or not false warnings should be displayed.booleandisplayWarning(BugInstance bugInstance) Return whether or not a warning should be displayed, according to the project filter settings.booleanstatic ProjectFilterSettingsCreate ProjectFilterSettings from an encoded string.Return set of active (enabled) bug categories.static StringgetIntPriorityAsString(int prio) Convert an integer warning priority threshold value to a String.Get the minimum warning priority threshold.intReturn the minimum warning priority threshold as an integer.intinthashCode()static voidhiddenFromEncodedString(ProjectFilterSettings result, String s) set the hidden bug categories on the specified ProjectFilterSettings from an encoded stringCreate a string containing the encoded form of the hidden bug categoriesvoidremoveCategory(String category) Remove a bug category from the set of categories to be displayed.voidsetDisplayFalseWarnings(boolean displayFalseWarnings) Set whether or not false warnings should be displayed.voidsetMinPriority(String minPriority) Set minimum warning priority threshold.voidsetMinRank(int minRank) Create a string containing the encoded form of the ProjectFilterSettings.toString()
-
Field Details
-
HIGH_PRIORITY
-
MEDIUM_PRIORITY
-
LOW_PRIORITY
-
EXPERIMENTAL_PRIORITY
-
DEFAULT_PRIORITY
-
priorityNameToValueMap
Map of priority level names to their numeric values. -
FIELD_DELIMITER
private static final char FIELD_DELIMITERThe character used for delimiting whole fields in filter settings encoded as strings- See Also:
-
LISTITEM_DELIMITER
The character used for delimiting list items in filter settings encoded as strings- See Also:
-
DEFAULT_MIN_RANK
private static final int DEFAULT_MIN_RANK- See Also:
-
activeBugCategorySet
-
minPriority
-
minPriorityAsInt
private int minPriorityAsInt -
minRank
private int minRank -
displayFalseWarnings
private boolean displayFalseWarnings
-
-
Constructor Details
-
ProjectFilterSettings
private ProjectFilterSettings()Constructor. This is not meant to be called directly; use one of the factory methods instead.
-
-
Method Details
-
setMinRank
public void setMinRank(int minRank) -
getMinRank
public int getMinRank() -
createDefault
Factory method to create a default ProjectFilterSettings object. Uses the default warning priority threshold, and enables all bug categories.- Returns:
- a default ProjectFilterSettings object
-
fromEncodedString
Create ProjectFilterSettings from an encoded string.- Parameters:
s- the encoded string- Returns:
- the ProjectFilterSettings
-
displayWarning
Return whether or not a warning should be displayed, according to the project filter settings.- Parameters:
bugInstance- the warning- Returns:
- true if the warning should be displayed, false if not
-
setMinPriority
Set minimum warning priority threshold.- Parameters:
minPriority- the priority threshold: one of "High", "Medium", or "Low"
-
getMinPriority
Get the minimum warning priority threshold.- Returns:
- minimum warning priority threshold: one of "High", "Medium", or "Low"
-
getMinPriorityAsInt
public int getMinPriorityAsInt()Return the minimum warning priority threshold as an integer.- Returns:
- the minimum warning priority threshold as an integer
-
addCategory
Add a bug category to the set of categories to be displayed.- Parameters:
category- the bug category: e.g., "CORRECTNESS"
-
removeCategory
Remove a bug category from the set of categories to be displayed.- Parameters:
category- the bug category: e.g., "CORRECTNESS"
-
clearAllCategories
public void clearAllCategories()Clear all bug categories from the hidden list. So the effect is to enable all bug categories. -
containsCategory
Returns false if the given category is hidden in the project filter settings.- Parameters:
category- the category- Returns:
- false if the category is hidden, true if not
-
getActiveCategorySet
-
setDisplayFalseWarnings
public void setDisplayFalseWarnings(boolean displayFalseWarnings) Set whether or not false warnings should be displayed.- Parameters:
displayFalseWarnings- true if false warnings should be displayed, false if not
-
displayFalseWarnings
public boolean displayFalseWarnings()Get whether or not false warnings should be displayed.- Returns:
- true if false warnings should be displayed, false if not
-
toEncodedString
Create a string containing the encoded form of the ProjectFilterSettings.- Returns:
- an encoded string
-
toString
-
equals
-
clone
-
hashCode
-
getIntPriorityAsString
Convert an integer warning priority threshold value to a String.
-