Class NpmAuditParser


  • public class NpmAuditParser
    extends java.lang.Object
    Parser for NPM Audit API response. This parser is derived from: https://github.com/DependencyTrack/dependency-track/blob/master/src/main/java/org/owasp/dependencytrack/parser/npm/audit/NpmAuditParser.java
    Author:
    Steve Springett
    • Constructor Summary

      Constructors 
      Constructor Description
      NpmAuditParser()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Advisory> parse​(org.json.JSONObject jsonResponse)
      Parses the JSON response from the NPM Audit API.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NpmAuditParser

        public NpmAuditParser()
    • Method Detail

      • parse

        public java.util.List<Advisory> parse​(org.json.JSONObject jsonResponse)
                                       throws org.json.JSONException
        Parses the JSON response from the NPM Audit API.
        Parameters:
        jsonResponse - the JSON node to parse
        Returns:
        an AdvisoryResults object
        Throws:
        org.json.JSONException - thrown if the JSON is not of the expected schema