Class ApiUtil
java.lang.Object
com.puppycrawl.tools.checkstyle.api.ApiUtil
Stateless helpers for API classes that historically contain implementation code.
These helpers can be removed together with that implementation in a future API redesign.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static intlengthExpandedTabs(String inputString, int toIdx, int tabWidth) Returns the length of a String prefix with tabs expanded.(package private) static booleanmatchesFileExtension(File file, String... fileExtensions) Returns whether the file extension matches what we are meant to process.
-
Constructor Details
-
ApiUtil
private ApiUtil()Private constructor for ApiUtil.
-
-
Method Details
-
matchesFileExtension
Returns whether the file extension matches what we are meant to process.- Parameters:
file- the file to be checked.fileExtensions- file extensions normalized byAbstractFileSetCheck.setFileExtensions(String...); null or empty arrays match all files.- Returns:
- whether there is a match.
-
lengthExpandedTabs
Returns the length of a String prefix with tabs expanded. Each tab is counted as the number of characters is takes to jump to the next tab stop.- Parameters:
inputString- the input StringtoIdx- index in string (exclusive) where the calculation stopstabWidth- the distance between tab stop position.- Returns:
- the length of string.substring(0, toIdx) with tabs expanded.
-