Class TaintPath.Builder

  • Enclosing class:
    TaintPath

    public static class TaintPath.Builder
    extends Object
    Accumulator for the endpoints and hop list of a TaintPath.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • source

        public TaintPath.Builder source​(TaintSource source)
        Sets the source definition the flow originates from.
        Parameters:
        source - the matched taint source
        Returns:
        this builder
      • sink

        public TaintPath.Builder sink​(TaintSink sink)
        Sets the sink definition the flow terminates at.
        Parameters:
        sink - the matched taint sink
        Returns:
        this builder
      • sourceNode

        public TaintPath.Builder sourceNode​(CPGNode node)
        Sets the CPG node where the taint enters.
        Parameters:
        node - the source call site
        Returns:
        this builder
      • sinkNode

        public TaintPath.Builder sinkNode​(CPGNode node)
        Sets the CPG node where the taint is consumed.
        Parameters:
        node - the sink call site
        Returns:
        this builder
      • addToPath

        public TaintPath.Builder addToPath​(CPGNode node)
        Appends one hop to the end of the path.
        Parameters:
        node - the node traversed
        Returns:
        this builder
      • path

        public TaintPath.Builder path​(List<CPGNode> path)
        Replaces the accumulated hops with the given sequence.
        Parameters:
        path - the nodes traversed, in order
        Returns:
        this builder
      • build

        public TaintPath build()
        Creates the path from the accumulated state; the hop list is copied.
        Returns:
        the new path, with no sanitizers recorded yet