Class ModuleNode
- java.lang.Object
-
- com.parasoft.findings.jenkins.coverage.model.Node
-
- com.parasoft.findings.jenkins.coverage.model.ModuleNode
-
- All Implemented Interfaces:
Serializable
public final class ModuleNode extends Node
ANode
which represents a module of a project.- Author:
- Melissa Bauer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ModuleNode(String name)
Creates a new module node with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSource(String source)
Appends the specified source to the list of sources.ModuleNode
copy()
Creates a copy of this instance that has no children and no parent yet.PackageNode
createPackageNode(String packageName)
Create a new package node with the given name and add it to the list of children.boolean
equals(Object o)
PackageNode
findOrCreatePackageNode(String packageName)
Searches for the specified package node.Set<String>
getSourceFolders()
Returns a collection of source folders that contain the source code files of allfile nodes
.int
hashCode()
void
splitPackages()
Splits flat packages into a package hierarchy.String
toString()
-
Methods inherited from class com.parasoft.findings.jenkins.coverage.model.Node
addAllChildren, addAllValues, addChild, addValue, aggregateValues, computeDelta, containsMetric, copyNode, copyTree, copyTree, filterByIndirectChanges, filterByModifiedFiles, filterByModifiedLines, filterTreeByIndirectChanges, filterTreeByModifiedFiles, filterTreeByModifiedLines, find, findByHashCode, findClass, findFile, findMethod, findPackage, getAll, getAllFileNodes, getAllMethodNodes, getChildren, getFiles, getMetric, getMetrics, getName, getParasoftToolName, getParent, getParentName, getTypedValue, getValue, getValueMetrics, getValues, hasChildren, hasModifiedLines, hasParent, isEmpty, isRoot, matches, matches, merge, merge, removeChild, replaceValue, setParasoftToolName
-
-
-
-
Constructor Detail
-
ModuleNode
public ModuleNode(String name)
Creates a new module node with the given name.- Parameters:
name
- the name of the module
-
-
Method Detail
-
copy
public ModuleNode copy()
Description copied from class:Node
Creates a copy of this instance that has no children and no parent yet. Node properties from the parent classNode
must not be copied. All other immutable properties need to be copied one by one.
-
getSourceFolders
public Set<String> getSourceFolders()
Description copied from class:Node
Returns a collection of source folders that contain the source code files of allfile nodes
.- Overrides:
getSourceFolders
in classNode
- Returns:
- a collection of source folders
-
addSource
public void addSource(String source)
Appends the specified source to the list of sources.- Parameters:
source
- the source to add
-
splitPackages
public void splitPackages()
Splits flat packages into a package hierarchy. Changes the internal tree structure of package nodes in place.Examples:
-
A package name
"edu"
will produce a single node with the name"edu"
. -
A package name
"edu.hm.hafner"
will produce three package nodes, that are linked together, starting with the"edu"
package ("edu" -> "hm" -> "hafner"
).
-
A package name
-
createPackageNode
public PackageNode createPackageNode(String packageName)
Create a new package node with the given name and add it to the list of children.- Parameters:
packageName
- the package name- Returns:
- the created and linked package node
-
findOrCreatePackageNode
public PackageNode findOrCreatePackageNode(String packageName)
Searches for the specified package node. If the package node is not found then a new package node will be created and linked to this module node.- Parameters:
packageName
- the package name- Returns:
- the existing or created package node
- See Also:
createPackageNode(String)
-
-