Class SuppressionHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.owasp.dependencycheck.xml.suppression.SuppressionHandler
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
@NotThreadSafe public class SuppressionHandler extends org.xml.sax.helpers.DefaultHandlerA handler to load suppression rules.- Author:
- Jeremy Long
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCPEThe CPE element name.static java.lang.StringCVEThe CVE element name.static java.lang.StringCVSS_BELOWThe cvssBelow element name.static java.lang.StringCWEThe CWE element name.static java.lang.StringFILE_PATHThe file path element name.static java.lang.StringGAVThe GAV element name.static java.lang.StringNOTESThe CVE element name.static java.lang.StringPACKAGE_URLThe Package URL element name.static java.lang.StringSHA1The sha1 hash element name.static java.lang.StringSUPPRESSThe suppress node, indicates the start of a new rule.static java.lang.StringVULNERABILITY_NAMEThe vulnerabilityName element name.
-
Constructor Summary
Constructors Constructor Description SuppressionHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Collects the body text of the node being processed.voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)Handles the end element event.java.util.List<SuppressionRule>getSuppressionRules()Get the value of suppressionRules.voidstartElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)Handles the start element event.
-
-
-
Field Detail
-
SUPPRESS
public static final java.lang.String SUPPRESS
The suppress node, indicates the start of a new rule.- See Also:
- Constant Field Values
-
FILE_PATH
public static final java.lang.String FILE_PATH
The file path element name.- See Also:
- Constant Field Values
-
SHA1
public static final java.lang.String SHA1
The sha1 hash element name.- See Also:
- Constant Field Values
-
CVE
public static final java.lang.String CVE
The CVE element name.- See Also:
- Constant Field Values
-
VULNERABILITY_NAME
public static final java.lang.String VULNERABILITY_NAME
The vulnerabilityName element name.- See Also:
- Constant Field Values
-
NOTES
public static final java.lang.String NOTES
The CVE element name.- See Also:
- Constant Field Values
-
CPE
public static final java.lang.String CPE
The CPE element name.- See Also:
- Constant Field Values
-
CWE
public static final java.lang.String CWE
The CWE element name.- See Also:
- Constant Field Values
-
GAV
public static final java.lang.String GAV
The GAV element name.- See Also:
- Constant Field Values
-
PACKAGE_URL
public static final java.lang.String PACKAGE_URL
The Package URL element name.- See Also:
- Constant Field Values
-
CVSS_BELOW
public static final java.lang.String CVSS_BELOW
The cvssBelow element name.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSuppressionRules
public java.util.List<SuppressionRule> getSuppressionRules()
Get the value of suppressionRules.- Returns:
- the value of suppressionRules
-
startElement
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXExceptionHandles the start element event.- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.DefaultHandler- Parameters:
uri- the URI of the element being processedlocalName- the local name of the element being processedqName- the qName of the element being processedattributes- the attributes of the element being processed- Throws:
org.xml.sax.SAXException- thrown if there is an exception processing
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionHandles the end element event.- Specified by:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.DefaultHandler- Parameters:
uri- the URI of the elementlocalName- the local name of the elementqName- the qName of the element- Throws:
org.xml.sax.SAXException- thrown if there is an exception processing
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXExceptionCollects the body text of the node being processed.- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Parameters:
ch- the char array of textstart- the start position to copy text from in the char arraylength- the number of characters to copy from the char array- Throws:
org.xml.sax.SAXException- thrown if there is a parsing exception
-
-