Class ResultAccess
java.lang.Object
com.hello2morrow.sonargraph.core.api.script.model.ResultAccess
Access object for storing script results. This object can be accessed via the global script variable "result".
-
Constructor Summary
ConstructorsConstructorDescriptionResultAccess
(com.hello2morrow.sonargraph.core.model.script.ScriptResultSet scriptResultSet) Internal constructor - do not use -
Method Summary
Modifier and TypeMethodDescriptionaddDependencyNode
(com.hello2morrow.sonargraph.core.api.model.DependencyAccess dependencyAccess) Add a root dependency node to the result tree.addDependencyNode
(NodeAccess nodeAccess, com.hello2morrow.sonargraph.core.api.model.DependencyAccess dependencyAccess) Add a dependency intermediate or leaf node to the result treevoid
addElement
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add an element to the list of results.boolean
addErrorIssue
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new error issue to the issues detected by this script.void
addErrorIssue
(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess lineAccess) Add a new error issue to the issues detected by this script.boolean
addInfoIssue
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new informational issue to the issues detected by this script.void
addInfoIssue
(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, int line) Add a new informational issue to the issues detected by this script.void
addInfoIssue
(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess sourceLineAccess) Add a new informational issue to the issues detected by this script.void
addMetricValue
(com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess id, com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> elementAccess, Number value) Add a custom metric value to the script result.addNode
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add a root node to the result tree.addNode
(NodeAccess nodeAccess, com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add a leaf or intermediate node to the result treeaddNode
(NodeAccess nodeAccess, String name) Add a named intermediate node to the result treeAdd a root node to the result tree.boolean
addWarningIssue
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new warning issue to the issues detected by this script.void
addWarningIssue
(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, int line) Add a new warning issue to the issues detected by this script.void
addWarningIssue
(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess sourceLineAccess) Add a new warning issue to the issues detected by this script.
-
Constructor Details
-
ResultAccess
public ResultAccess(com.hello2morrow.sonargraph.core.model.script.ScriptResultSet scriptResultSet) Internal constructor - do not use
-
-
Method Details
-
addElement
public void addElement(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add an element to the list of results.- Parameters:
elementAccess
- The element to be added
-
addMetricValue
public void addMetricValue(com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess id, com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> elementAccess, Number value) Add a custom metric value to the script result.- Parameters:
id
- The metric identifierelementAccess
- The element associated with the metricvalue
- The metric value- See Also:
-
addNode
Add a root node to the result tree.- Parameters:
name
- Node name.- Returns:
- A new node access object.
-
addNode
public NodeAccess addNode(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add a root node to the result tree.- Parameters:
elementAccess
- The element associated with this node- Returns:
- A new node access object.
-
addNode
public NodeAccess addNode(NodeAccess nodeAccess, com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.Element> elementAccess) Add a leaf or intermediate node to the result tree- Parameters:
nodeAccess
- The parent nodeelementAccess
- The element associated with this node- Returns:
- A new node access object
-
addNode
Add a named intermediate node to the result tree- Parameters:
nodeAccess
- The parent nodename
- Node name- Returns:
- A new node access object
-
addDependencyNode
public NodeAccess addDependencyNode(NodeAccess nodeAccess, com.hello2morrow.sonargraph.core.api.model.DependencyAccess dependencyAccess) Add a dependency intermediate or leaf node to the result tree- Parameters:
nodeAccess
- The parent nodedependencyAccess
- The dependency associated with this node.- Returns:
- A new node access object
-
addDependencyNode
public NodeAccess addDependencyNode(com.hello2morrow.sonargraph.core.api.model.DependencyAccess dependencyAccess) Add a root dependency node to the result tree.- Parameters:
dependencyAccess
- The dependency associated with this node- Returns:
- A new node access object
-
addErrorIssue
public boolean addErrorIssue(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new error issue to the issues detected by this script.- Parameters:
elementAccess
- The element associated with the errorissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the error- Returns:
- 'true' if the issue could be added - excluded elements and elements ignoring issues do not carry issues
-
addInfoIssue
public boolean addInfoIssue(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new informational issue to the issues detected by this script.- Parameters:
elementAccess
- The element associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issue- Returns:
- 'true' if the issue could be added - excluded elements and elements ignoring issues do not carry issues
-
addWarningIssue
public boolean addWarningIssue(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, String issueId, String description) Add a new warning issue to the issues detected by this script.- Parameters:
elementAccess
- The element associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issue- Returns:
- 'true' if the issue could be added - excluded elements and elements ignoring issues do not carry issues
-
addWarningIssue
public void addWarningIssue(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, int line) Add a new warning issue to the issues detected by this script.- Parameters:
sourceFileAccess
- The source file associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issueline
- The line number
-
addErrorIssue
public void addErrorIssue(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess lineAccess) Add a new error issue to the issues detected by this script.- Parameters:
sourceFileAccess
- The source file associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issueline
- The line number
-
addWarningIssue
public void addWarningIssue(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess sourceLineAccess) Add a new warning issue to the issues detected by this script.- Parameters:
sourceFileAccess
- The source file associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issueline
- The
-
addInfoIssue
public void addInfoIssue(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, int line) Add a new informational issue to the issues detected by this script.- Parameters:
sourceFileAccess
- The source file associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issueline
- The line number
-
addInfoIssue
public void addInfoIssue(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, String issueId, String description, com.hello2morrow.sonargraph.core.api.model.SourceLineAccess sourceLineAccess) Add a new informational issue to the issues detected by this script.- Parameters:
sourceFileAccess
- The source file associated with the issueissueId
- A unique issue id describing the issue classdescription
- A more detailed description of the issueline
- The line number
-