Class SuppressionParser


  • @ThreadSafe
    public class SuppressionParser
    extends java.lang.Object
    A simple validating parser for XML Suppression Rules.
    Author:
    Jeremy Long
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SUPPRESSION_SCHEMA_1_1
      The suppression schema file location for v1.1.
      static java.lang.String SUPPRESSION_SCHEMA_1_2
      The suppression schema file location for v 1.2.
      static java.lang.String SUPPRESSION_SCHEMA_1_3
      The suppression schema file location for v 1.3.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • SuppressionParser

        public SuppressionParser()
    • 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 parsed
        org.xml.sax.SAXException - thrown if the XML cannot be parsed