Class SuppressionParser
java.lang.Object
org.owasp.dependencycheck.xml.suppression.SuppressionParser
A simple validating parser for XML Suppression Rules.
- Author:
- Jeremy Long
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe suppression schema file location for v1.1.static final StringThe suppression schema file location for v 1.2.static final StringThe suppression schema file location for v 1.3.static final StringThe suppression schema file location for v 1.4. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseSuppressionRules(File file) Parses the given XML file and returns a list of the suppression rules contained.parseSuppressionRules(InputStream inputStream) Parses the given XML stream and returns a list of the suppression rules contained.
-
Field Details
-
SUPPRESSION_SCHEMA_1_4
The suppression schema file location for v 1.4.- See Also:
-
SUPPRESSION_SCHEMA_1_3
The suppression schema file location for v 1.3.- See Also:
-
SUPPRESSION_SCHEMA_1_2
The suppression schema file location for v 1.2.- See Also:
-
SUPPRESSION_SCHEMA_1_1
The suppression schema file location for v1.1.- See Also:
-
-
Constructor Details
-
SuppressionParser
public SuppressionParser()
-
-
Method Details
-
parseSuppressionRules
Parses the given XML file and returns a list of the suppression rules contained.- Parameters:
file- an XML file containing suppression rules- Returns:
- a list of suppression rules
- Throws:
SuppressionParseException- thrown if the XML file cannot be parsed
-
parseSuppressionRules
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream) throws SuppressionParseException, SAXException Parses the given XML stream and returns a list of the suppression rules contained.- Parameters:
inputStream- an InputStream containing suppression rules- Returns:
- a list of suppression rules
- Throws:
SuppressionParseException- thrown if the XML cannot be parsedSAXException- thrown if the XML cannot be parsed
-