Package edu.hm.hafner.analysis
Class Categories
- java.lang.Object
-
- edu.hm.hafner.analysis.Categories
-
public final class Categories extends Object
Provides convenience methods to detect categories.- Author:
- Ullrich Hafner
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEPRECATIONCategory for warnings due to usage of deprecate API.static StringJAVADOCCategory for Javadoc warnings.static StringOTHERCategory for Other warnings.static StringPROPRIETARY_APICategory for warnings due to the usage of proprietary API.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringguessCategory(String message)Classifies the warning message: tries to guess a category from the warning message.static StringguessCategoryIfEmpty(String category, String message)Returns a category for the current warning.
-
-
-
Field Detail
-
DEPRECATION
public static final String DEPRECATION
Category for warnings due to usage of deprecate API.- See Also:
- Constant Field Values
-
PROPRIETARY_API
public static final String PROPRIETARY_API
Category for warnings due to the usage of proprietary API.- See Also:
- Constant Field Values
-
JAVADOC
public static final String JAVADOC
Category for Javadoc warnings.- See Also:
- Constant Field Values
-
OTHER
public static final String OTHER
Category for Other warnings.- See Also:
- Constant Field Values
-
-
Method Detail
-
guessCategory
public static String guessCategory(@CheckForNull String message)
Classifies the warning message: tries to guess a category from the warning message.- Parameters:
message- the message to check- Returns:
- warning category, empty string if unknown
-
guessCategoryIfEmpty
public static String guessCategoryIfEmpty(@CheckForNull String category, @CheckForNull String message)
Returns a category for the current warning. If the provided category is not empty, then a capitalized string is returned. Otherwise the category is obtained from the specified message text.- Parameters:
category- the warning category (might be empty)message- the warning message- Returns:
- the actual category
-
-