public class BaseFileInfo extends Object implements FileInfo
| Modifier and Type | Field and Description |
|---|---|
protected long |
checksum |
protected BasePackageInfo |
containingPackage |
protected ContextSet |
contextFilter |
protected String |
encoding |
protected long |
filesize |
protected int |
lineCount |
protected BlockMetrics |
metrics |
protected String |
name |
protected int |
ncLineCount |
protected BlockMetrics |
rawMetrics |
protected long |
timestamp |
| Constructor and Description |
|---|
BaseFileInfo(BasePackageInfo containingPackage,
String name,
String encoding,
int lineCount,
int ncLineCount,
long timestamp,
long filesize,
long checksum) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
List<? extends ClassInfo> |
getAllClasses()
Returns list of all classes, including indirect descendants.
|
List<? extends MethodInfo> |
getAllMethods()
Returns list of all methods, including indirect descendants.
|
long |
getChecksum() |
List<? extends ClassInfo> |
getClasses()
Returns list of classes which are declared on a top-level of this source file (i.e.
|
PackageInfo |
getContainingPackage()
Returns a package for which this package belongs to (or the default package)
Note: it supports only one package namespace per source file
|
ContextSet |
getContextFilter()
Returns context filter for the entity, i.e set of custom statement/method contexts as well as Clover's built-in
code contexts.
|
int |
getDataIndex() |
int |
getDataLength() |
String |
getEncoding()
Returns file encoding, e.g.
|
int |
getEndColumn() |
int |
getEndLine() |
long |
getFilesize()
Returns file size in bytes
|
int |
getLineCount()
Returns number of source lines in a file
|
List<? extends MethodInfo> |
getMethods()
Returns list of methods which are declared on a top-level of this source file.
|
BlockMetrics |
getMetrics() |
String |
getName()
Returns source file name
|
int |
getNcLineCount()
Returns number of non-comment and non-empty source lines in a file.
|
String |
getPackagePath()
Returns a file name with a package path, e.g.
|
EntityContainer |
getParent() |
BlockMetrics |
getRawMetrics() |
int |
getStartColumn() |
int |
getStartLine() |
List<? extends StatementInfo> |
getStatements()
Returns list of statements which are declared on a top-level of this source file.
|
long |
getTimestamp()
Returns file modification time stamp as per File.lastModified()
|
int |
hashCode() |
boolean |
isEmpty()
Returns true if the file does not contain any inner code entities.
|
boolean |
isTestFile()
Returns true if this is a test file (according to the test pattern defined during instrumentation)
|
void |
setContainingPackage(BasePackageInfo containingPackage) |
void |
setMetrics(BlockMetrics metrics) |
void |
visit(EntityVisitor entityVisitor)
Visit yourself
|
protected String name
protected String encoding
protected int lineCount
protected int ncLineCount
protected long timestamp
protected long filesize
protected long checksum
protected transient BasePackageInfo containingPackage
protected transient BlockMetrics rawMetrics
protected transient BlockMetrics metrics
protected transient ContextSet contextFilter
public BaseFileInfo(BasePackageInfo containingPackage, String name, String encoding, int lineCount, int ncLineCount, long timestamp, long filesize, long checksum)
public boolean isTestFile()
FileInfoisTestFile in interface FileInfo@NotNull public List<? extends ClassInfo> getClasses()
FileInfogetClasses in interface FileInfogetClasses in interface HasClasses@NotNull public List<? extends ClassInfo> getAllClasses()
HasClassesgetAllClasses in interface HasClasses@NotNull public List<? extends MethodInfo> getMethods()
FileInfogetMethods in interface FileInfogetMethods in interface HasMethods@NotNull public List<? extends MethodInfo> getAllMethods()
HasMethodsgetAllMethods in interface HasMethods@NotNull public List<? extends StatementInfo> getStatements()
FileInfogetStatements in interface FileInfogetStatements in interface HasStatementspublic String getName()
FileInfogetName in interface FileInfogetName in interface HasMetricspublic BlockMetrics getMetrics()
getMetrics in interface HasMetricspublic void setMetrics(BlockMetrics metrics)
setMetrics in interface HasMetricspublic BlockMetrics getRawMetrics()
getRawMetrics in interface HasMetricspublic String getEncoding()
FileInfogetEncoding in interface FileInfopublic long getTimestamp()
FileInfogetTimestamp in interface FileInfopublic long getFilesize()
FileInfogetFilesize in interface FileInfopublic long getChecksum()
getChecksum in interface FileInfopublic String getPackagePath()
FileInfogetPackagePath in interface FileInfopublic PackageInfo getContainingPackage()
FileInfogetContainingPackage in interface FileInfopublic void setContainingPackage(BasePackageInfo containingPackage)
public EntityContainer getParent()
public ContextSet getContextFilter()
HasContextFiltergetContextFilter in interface HasContextFilterpublic int getLineCount()
FileInfogetLineCount in interface FileInfopublic int getNcLineCount()
FileInfogetNcLineCount in interface FileInfopublic boolean isEmpty()
FileInfopublic int getDataIndex()
getDataIndex in interface InstrumentationInfopublic int getDataLength()
getDataLength in interface InstrumentationInfopublic int getStartLine()
getStartLine in interface SourceInfopublic int getStartColumn()
getStartColumn in interface SourceInfopublic int getEndLine()
getEndLine in interface SourceInfopublic int getEndColumn()
getEndColumn in interface SourceInfopublic void visit(EntityVisitor entityVisitor)
visit in interface EntityContainerentityVisitor - callbackCopyright © 2024 OpenClover.org. All rights reserved.