|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.FileContents
Represents the contents of a file.
| Constructor Summary | |
FileContents(java.lang.String aFilename,
java.lang.String[] aLines)
Creates a new FileContents instance. |
|
| Method Summary | |
java.util.Map |
getCComments()
Returns a map of all C style comments. |
java.util.Map |
getCppComments()
Returns a map of all the C++ style comments. |
java.lang.String |
getFilename()
|
TextBlock |
getJavadocBefore(int aLineNo)
Returns the Javadoc comment before the specified line. |
java.lang.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(java.lang.String aType,
int aStartLineNo,
int aStartColNo,
int aEndLineNo,
int aEndColNo)
Report the location of a block comment that can span multiple lines. The type of comment is identified by a String whose value depends on the language being parsed, but would typically be the delimiter for the comment. |
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(java.lang.String aType,
int aStartLineNo,
int aStartColNo)
Report the location of a single line comment that extends from the given point to the end of the line. The type of comment is identified by a String whose value depends on the language being parsed, but would typically be the delimiter for the comment. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileContents(java.lang.String aFilename,
java.lang.String[] aLines)
FileContents instance.
aFilename - name of the fileaLines - the contents of the file| Method Detail |
public void reportSingleLineComment(java.lang.String aType,
int aStartLineNo,
int aStartColNo)
reportSingleLineComment in interface CommentListeneraType - an identifier for what type of comment it is.aStartLineNo - the starting line numberaStartColNo - the starting column number
public void reportBlockComment(java.lang.String aType,
int aStartLineNo,
int aStartColNo,
int aEndLineNo,
int aEndColNo)
reportBlockComment in interface CommentListeneraType - an identifier for what type of comment it is.aStartLineNo - the starting line numberaStartColNo - the starting column numberaEndLineNo - the ending line numberaEndColNo - the ending column number
public void reportCppComment(int aStartLineNo,
int aStartColNo)
aStartLineNo - the starting line numberaStartColNo - the starting column numberpublic java.util.Map getCppComments()
public void reportCComment(int aStartLineNo,
int aStartColNo,
int aEndLineNo,
int aEndColNo)
aStartLineNo - the starting line numberaStartColNo - the starting column numberaEndLineNo - the ending line numberaEndColNo - the ending column numberpublic java.util.Map getCComments()
public TextBlock getJavadocBefore(int aLineNo)
null means there is no such comment.
aLineNo - the line number to check before
null if nonepublic java.lang.String[] getLines()
public java.lang.String getFilename()
public boolean lineIsBlank(int aLineNo)
aLineNo - the line number to check
public boolean lineIsComment(int aLineNo)
aLineNo - the line number to check
public boolean hasIntersectionWithComment(int aStartLineNo,
int aStartColNo,
int aEndLineNo,
int aEndColNo)
aStartLineNo - the starting line numberaStartColNo - the starting column numberaEndLineNo - the ending line numberaEndColNo - the ending column number
|
Back to the Checkstyle Home Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||