Class Filter

  • All Implemented Interfaces:
    Matcher

    public class Filter
    extends OrMatcher
    Filter to match a subset of BugInstances. The filter criteria are read from an XML file.
    Author:
    David Hovemeyer
    • Constructor Detail

      • Filter

        public Filter()
        Constructor for empty filter
      • Filter

        public Filter​(java.lang.String fileName)
               throws java.io.IOException
        Constructor.
        Parameters:
        fileName - name of the filter file
        Throws:
        java.io.IOException
      • Filter

        public Filter​(java.io.InputStream stream)
               throws java.io.IOException
        Constructor.
        Parameters:
        stream - content of the filter file
        Throws:
        java.io.IOException
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • setEnabled

        public void setEnabled​(Matcher m,
                               boolean value)
      • disable

        public void disable​(Matcher m)
      • isEnabled

        public boolean isEnabled​(Matcher m)
      • enable

        public void enable​(Matcher m)
      • parseFilter

        public static Filter parseFilter​(java.lang.String fileName)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • contains

        public boolean contains​(Matcher child)
      • softAdd

        public void softAdd​(Matcher child)
        Add if not present, but do not enable if already present and disabled
        Parameters:
        child -
      • match

        public boolean match​(BugInstance bugInstance)
        Description copied from interface: Matcher
        Determine whether or not the given BugInstance has the feature this Matcher tests for.
        Specified by:
        match in interface Matcher
        Overrides:
        match in class OrMatcher
        Parameters:
        bugInstance - the BugInstance
        Returns:
        true if the BugInstance matches, false if not
      • main

        public static void main​(java.lang.String[] argv)
      • writeAsXML

        public void writeAsXML​(@WillClose
                               java.io.OutputStream out)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • writeEnabledMatchersAsXML

        public void writeEnabledMatchersAsXML​(@WillClose
                                              java.io.OutputStream out)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBodyAsXML

        public void writeBodyAsXML​(XMLOutput xmlOutput)
                            throws java.io.IOException
        Throws:
        java.io.IOException