Class ResultAccess


  • public final class ResultAccess
    extends java.lang.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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      NodeAccess addDependencyNode​(com.hello2morrow.sonargraph.core.api.model.DependencyAccess dependencyAccess)
      Add a root dependency node to the result tree.
      NodeAccess 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, java.lang.String issueId, java.lang.String description)
      Add a new error issue to the issues detected by this script.
      void addErrorIssue​(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, java.lang.String issueId, java.lang.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, java.lang.String issueId, java.lang.String description)
      Add a new informational issue to the issues detected by this script.
      void addInfoIssue​(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, java.lang.String issueId, java.lang.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, java.lang.String issueId, java.lang.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, java.lang.Number value)
      Add a custom metric value to the script result.
      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.
      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
      NodeAccess addNode​(NodeAccess nodeAccess, java.lang.String name)
      Add a named intermediate node to the result tree
      NodeAccess addNode​(java.lang.String name)
      Add a root node to the result tree.
      boolean addWarningIssue​(com.hello2morrow.sonargraph.core.api.model.ElementAccess<?> elementAccess, java.lang.String issueId, java.lang.String description)
      Add a new warning issue to the issues detected by this script.
      void addWarningIssue​(com.hello2morrow.sonargraph.core.api.model.SourceFileAccess sourceFileAccess, java.lang.String issueId, java.lang.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, java.lang.String issueId, java.lang.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 Detail

      • ResultAccess

        public ResultAccess​(com.hello2morrow.sonargraph.core.model.script.ScriptResultSet scriptResultSet)
        Internal constructor - do not use
    • Method Detail

      • 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
      • addNode

        public NodeAccess addNode​(java.lang.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,
                                  java.lang.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,
                                     java.lang.String issueId,
                                     java.lang.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,
                                    java.lang.String issueId,
                                    java.lang.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,
                                       java.lang.String issueId,
                                       java.lang.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,
                                    java.lang.String issueId,
                                    java.lang.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,
                                  java.lang.String issueId,
                                  java.lang.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,
                                    java.lang.String issueId,
                                    java.lang.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,
                                 java.lang.String issueId,
                                 java.lang.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,
                                 java.lang.String issueId,
                                 java.lang.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