Class HintParser
- java.lang.Object
-
- org.owasp.dependencycheck.xml.hints.HintParser
-
@NotThreadSafe public class HintParser extends java.lang.Object
A simple validating parser for XML Hint Rules.- Author:
- Jeremy Long
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JAXP_SCHEMA_LANGUAGE
JAXP Schema Language.static java.lang.String
JAXP_SCHEMA_SOURCE
JAXP Schema Source.static java.lang.String
W3C_XML_SCHEMA
W3C XML Schema.
-
Constructor Summary
Constructors Constructor Description HintParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<HintRule>
getHintRules()
Returns the hint rules.java.util.List<VendorDuplicatingHintRule>
getVendorDuplicatingHintRules()
Returns the vendor duplicating hint rules.void
parseHints(java.io.File file)
Parses the given XML file and returns a list of the hints contained.void
parseHints(java.io.InputStream inputStream)
Parses the given XML stream and returns a list of the hint rules contained.
-
-
-
Field Detail
-
JAXP_SCHEMA_LANGUAGE
public static final java.lang.String JAXP_SCHEMA_LANGUAGE
JAXP Schema Language. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html- See Also:
- Constant Field Values
-
W3C_XML_SCHEMA
public static final java.lang.String W3C_XML_SCHEMA
W3C XML Schema. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html- See Also:
- Constant Field Values
-
JAXP_SCHEMA_SOURCE
public static final java.lang.String JAXP_SCHEMA_SOURCE
JAXP Schema Source. Source: http://docs.oracle.com/javase/tutorial/jaxp/sax/validation.html- See Also:
- Constant Field Values
-
-
Method Detail
-
getHintRules
public java.util.List<HintRule> getHintRules()
Returns the hint rules.- Returns:
- the hint rules
-
getVendorDuplicatingHintRules
public java.util.List<VendorDuplicatingHintRule> getVendorDuplicatingHintRules()
Returns the vendor duplicating hint rules.- Returns:
- the vendor duplicating hint rules
-
parseHints
public void parseHints(java.io.File file) throws HintParseException
Parses the given XML file and returns a list of the hints contained.- Parameters:
file
- an XML file containing hints- Throws:
HintParseException
- thrown if the XML file cannot be parsed
-
parseHints
public void parseHints(java.io.InputStream inputStream) throws HintParseException, org.xml.sax.SAXException
Parses the given XML stream and returns a list of the hint rules contained.- Parameters:
inputStream
- an InputStream containing hint rules- Throws:
HintParseException
- thrown if the XML cannot be parsedorg.xml.sax.SAXException
- thrown if the XML cannot be parsed
-
-