public class BasePackageInfo extends Object implements PackageInfo, CachingInfo
| Modifier and Type | Field and Description |
|---|---|
protected List<? extends ClassInfo> |
allClasses
All classes in this package
|
protected List<? extends ClassInfo> |
classes
Top-level classes in this package
|
protected BaseProjectInfo |
containingProject |
protected ContextSet |
contextFilter |
protected boolean |
defaultPkg |
protected Map<String,FileInfo> |
files |
protected BlockMetrics |
metrics |
protected String |
name |
protected String |
path |
protected BlockMetrics |
rawMetrics |
DEFAULT_PACKAGE_NAME| Constructor and Description |
|---|
BasePackageInfo(BaseProjectInfo containingProject,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFile(BaseFileInfo file) |
protected void |
gatherAllClassesFromPackage() |
protected void |
gatherClassesFromPackage() |
List<? extends ClassInfo> |
getAllClasses()
Returns list of all classes (including inner or inline classes) declared in this package.
|
List<? extends ClassInfo> |
getAllClassesIncludingSubPackages()
Returns list of all classes (including inner or inline classes) declared in this package AND all sub-packages.
|
List<? extends ClassInfo> |
getClasses()
Return list of top-level classes declared in this package namespace.
|
List<? extends ClassInfo> |
getClasses(HasMetricsFilter filter)
Return list of top-level classes declared in this package matching the filter
|
List<? extends ClassInfo> |
getClassesIncludingSubPackages()
Return list of top-level classes declared in this package namespace as well as from sub-packages.
|
ProjectInfo |
getContainingProject()
Returns a project containing this package.
|
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.
|
BaseFileInfo |
getFile(String packagePath) |
BaseFileInfo |
getFileInPackage(String name) |
List<? extends FileInfo> |
getFiles()
Returns list of source files belonging to this package namespace.
|
BlockMetrics |
getMetrics() |
String |
getName() |
EntityContainer |
getParent()
Return parent project
|
String |
getPath() |
BlockMetrics |
getRawMetrics() |
void |
invalidateCaches() |
boolean |
isChildOrDescendantOf(BasePackageInfo other) |
boolean |
isDefault() |
static boolean |
isDefaultName(String name) |
boolean |
isDescendantOf(PackageInfo other) |
boolean |
isEmpty() |
boolean |
isNamed(String name) |
void |
setMetrics(BlockMetrics metrics) |
void |
visit(EntityVisitor entityVisitor)
Visit yourself
|
void |
visitFiles(FileInfoVisitor visitor) |
protected final String name
protected final boolean defaultPkg
protected final String path
protected BaseProjectInfo containingProject
protected BlockMetrics rawMetrics
protected BlockMetrics metrics
protected ContextSet contextFilter
public BasePackageInfo(BaseProjectInfo containingProject, String name)
public static boolean isDefaultName(String name)
public EntityContainer getParent()
getParent in interface HasParentgetParent in interface PackageInfoProjectInfopublic void visit(EntityVisitor entityVisitor)
visit in interface EntityContainerentityVisitor - callbackpublic ProjectInfo getContainingProject()
PackageInfogetContainingProject in interface PackageInfoProjectInfopublic ContextSet getContextFilter()
HasContextFiltergetContextFilter in interface HasContextFilterpublic String getName()
getName in interface HasMetricsgetName in interface PackageInfopublic String getPath()
getPath in interface PackageInfopublic boolean isDefault()
isDefault in interface PackageInfopublic boolean isEmpty()
isEmpty in interface PackageInfo@NotNull public List<? extends FileInfo> getFiles()
PackageInfogetFiles in interface HasFilesgetFiles in interface PackageInfopublic void addFile(BaseFileInfo file)
public BaseFileInfo getFile(String packagePath)
public BaseFileInfo getFileInPackage(String name)
@NotNull public List<? extends ClassInfo> getClasses()
getClasses in interface HasClassesgetClasses in interface PackageInfo@NotNull public List<? extends ClassInfo> getClassesIncludingSubPackages()
getClassesIncludingSubPackages in interface PackageInfopublic List<? extends ClassInfo> getClasses(HasMetricsFilter filter)
filter - metrics filter to be applied@NotNull public List<? extends ClassInfo> getAllClasses()
PackageInfogetAllClasses in interface HasClassesgetAllClasses in interface PackageInfo@NotNull public List<? extends ClassInfo> getAllClassesIncludingSubPackages()
PackageInfogetAllClassesIncludingSubPackages in interface PackageInfopublic boolean isDescendantOf(PackageInfo other)
isDescendantOf in interface PackageInfopublic BlockMetrics getRawMetrics()
getRawMetrics in interface HasMetricspublic BlockMetrics getMetrics()
getMetrics in interface HasMetricspublic void setMetrics(BlockMetrics metrics)
setMetrics in interface HasMetricspublic void visitFiles(FileInfoVisitor visitor)
public boolean isChildOrDescendantOf(BasePackageInfo other)
public boolean isNamed(String name)
public void invalidateCaches()
invalidateCaches in interface CachingInfoprotected void gatherClassesFromPackage()
protected void gatherAllClassesFromPackage()
Copyright © 2024 OpenClover.org. All rights reserved.