java.lang.Object
com.hello2morrow.sonargraph.core.api.script.model.ResultAccess

public final class ResultAccess extends Object
Access object for storing script results. This object can be accessed via the global script variable "result".
  • Constructor Summary

    Constructors
    Constructor
    Description
    ResultAccess(com.hello2morrow.sonargraph.core.model.script.ScriptResultSet scriptResultSet)
    Internal constructor - do not use
  • Method Summary

    Modifier and Type
    Method
    Description
    addDependencyNode(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 tree
    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.
    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 tree
    addNode(NodeAccess nodeAccess, String name)
    Add a named intermediate node to the result tree
    Add 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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 identifier
      elementAccess - The element associated with the metric
      value - The metric value
      See Also:
    • addNode

      public NodeAccess addNode(String name)
      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 node
      elementAccess - The element associated with this node
      Returns:
      A new node access object
    • addNode

      public NodeAccess addNode(NodeAccess nodeAccess, String name)
      Add a named intermediate node to the result tree
      Parameters:
      nodeAccess - The parent node
      name - 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 node
      dependencyAccess - 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 error
      issueId - A unique issue id describing the issue class
      description - 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 issue
      issueId - A unique issue id describing the issue class
      description - 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 issue
      issueId - A unique issue id describing the issue class
      description - 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 issue
      issueId - A unique issue id describing the issue class
      description - A more detailed description of the issue
      line - 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 issue
      issueId - A unique issue id describing the issue class
      description - A more detailed description of the issue
      line - 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 issue
      issueId - A unique issue id describing the issue class
      description - A more detailed description of the issue
      line - 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 issue
      issueId - A unique issue id describing the issue class
      description - A more detailed description of the issue
      line - 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 issue
      issueId - A unique issue id describing the issue class
      description - A more detailed description of the issue
      line - The line number