com.puppycrawl.tools.checkstyle.api
public final class FileContents extends Object implements CommentListener
Version: 1.0
| Constructor Summary | |
|---|---|
| FileContents(String aFilename, String[] aLines)
Creates a new FileContents instance.
| |
| Method Summary | |
|---|---|
| Map | getCComments()
Returns a map of all C style comments. |
| Map | getCppComments()
Returns a map of all the C++ style comments. |
| String | getFilename() |
| TextBlock | getJavadocBefore(int aLineNo)
Returns the Javadoc comment before the specified line.
|
| String[] | getLines() |
| boolean | hasIntersectionWithComment(int aStartLineNo, int aStartColNo, int aEndLineNo, int aEndColNo)
Checks if the specified position intersects with a comment. |
| boolean | lineIsBlank(int aLineNo)
Checks if the specified line is blank. |
| boolean | lineIsComment(int aLineNo)
Checks if the specified line is a single-line comment without code. |
| void | reportBlockComment(String aType, int aStartLineNo, int aStartColNo, int aEndLineNo, int aEndColNo) |
| void | reportCComment(int aStartLineNo, int aStartColNo, int aEndLineNo, int aEndColNo)
Report the location of a C-style comment. |
| void | reportCppComment(int aStartLineNo, int aStartColNo)
Report the location of a C++ style comment. |
| void | reportSingleLineComment(String aType, int aStartLineNo, int aStartColNo) |
FileContents instance.
Parameters: aFilename name of the file aLines the contents of the file
Returns: the map of comments
Returns: the Map of comments
Returns: the name of the file
null means there is no such comment.Parameters: aLineNo the line number to check before
Returns: the Javadoc comment, or null if none
Returns: the lines in the file
Parameters: aStartLineNo the starting line number aStartColNo the starting column number aEndLineNo the ending line number aEndColNo the ending column number
Returns: true if the positions intersects with a comment.
Parameters: aLineNo the line number to check
Returns: if the specified line consists only of tabs and spaces.
Parameters: aLineNo the line number to check
Returns: if the specified line consists of only a single line comment without code.
Parameters: aStartLineNo the starting line number aStartColNo the starting column number aEndLineNo the ending line number aEndColNo the ending column number
Parameters: aStartLineNo the starting line number aStartColNo the starting column number