Class SuppressionParser
- java.lang.Object
-
- org.owasp.dependencycheck.xml.suppression.SuppressionParser
-
@ThreadSafe public class SuppressionParser extends java.lang.ObjectA simple validating parser for XML Suppression Rules.- Author:
- Jeremy Long
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSUPPRESSION_SCHEMA_1_1The suppression schema file location for v1.1.static java.lang.StringSUPPRESSION_SCHEMA_1_2The suppression schema file location for v 1.2.static java.lang.StringSUPPRESSION_SCHEMA_1_3The suppression schema file location for v 1.3.
-
Constructor Summary
Constructors Constructor Description SuppressionParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SuppressionRule>parseSuppressionRules(java.io.File file)Parses the given XML file and returns a list of the suppression rules contained.java.util.List<SuppressionRule>parseSuppressionRules(java.io.InputStream inputStream)Parses the given XML stream and returns a list of the suppression rules contained.
-
-
-
Field Detail
-
SUPPRESSION_SCHEMA_1_3
public static final java.lang.String SUPPRESSION_SCHEMA_1_3
The suppression schema file location for v 1.3.- See Also:
- Constant Field Values
-
SUPPRESSION_SCHEMA_1_2
public static final java.lang.String SUPPRESSION_SCHEMA_1_2
The suppression schema file location for v 1.2.- See Also:
- Constant Field Values
-
SUPPRESSION_SCHEMA_1_1
public static final java.lang.String SUPPRESSION_SCHEMA_1_1
The suppression schema file location for v1.1.- See Also:
- Constant Field Values
-
-
Method Detail
-
parseSuppressionRules
public java.util.List<SuppressionRule> parseSuppressionRules(java.io.File file) throws SuppressionParseException
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 java.util.List<SuppressionRule> parseSuppressionRules(java.io.InputStream inputStream) throws SuppressionParseException, org.xml.sax.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 parsedorg.xml.sax.SAXException- thrown if the XML cannot be parsed
-
-