Class SuppressionHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.owasp.dependencycheck.xml.suppression.SuppressionHandler
- All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
A handler to load suppression rules. In the input xml a suppression rule can be part of a
suppressionGroup. In that
case the attributes set on group element will act as default values for child suppressions.- Author:
- Jeremy Long
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CPE element name.static final StringThe CVE element name.static final StringThe cvssBelow element name.static final StringThe cvssV2Below element name.static final StringThe cvssV3Below element name.static final StringThe cvssV4Below element name.static final StringThe CWE element name.static final StringThe file path element name.static final StringThe GAV element name.static final StringThe CVE element name.static final StringThe Package URL element name.static final StringThe sha1 hash element name.static final StringThe suppress node, indicates the start of a new rule.static final StringThe suppressionGroup node, indicates the start of a new suppressionGroup.static final StringThe vulnerabilityName element name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Collects the body text of the node being processed.voidendElement(String uri, String localName, String qName) Handles the end element event.Get the value of suppressionRules.voidstartElement(String uri, String localName, String qName, Attributes attributes) Handles the start element event.Methods inherited from class DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
Field Details
-
SUPPRESSION_GROUP
The suppressionGroup node, indicates the start of a new suppressionGroup.- See Also:
-
SUPPRESS
-
FILE_PATH
-
SHA1
-
CVE
-
VULNERABILITY_NAME
-
NOTES
-
CPE
-
CWE
-
GAV
-
PACKAGE_URL
-
CVSS_BELOW
-
CVSS_V2_BELOW
-
CVSS_V3_BELOW
-
CVSS_V4_BELOW
-
-
Constructor Details
-
SuppressionHandler
public SuppressionHandler()
-
-
Method Details
-
getSuppressionRules
Get the value of suppressionRules.- Returns:
- the value of suppressionRules
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Handles the start element event.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- 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:
SAXException- thrown if there is an exception processing
-
endElement
Handles the end element event.- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
uri- the URI of the elementlocalName- the local name of the elementqName- the qName of the element- Throws:
SAXException- thrown if there is an exception processing
-
characters
Collects the body text of the node being processed.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- 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:
SAXException- thrown if there is a parsing exception
-