FindBugs™ 1.3.9

edu.umd.cs.findbugs.filter
Class Filter

java.lang.Object
  extended by edu.umd.cs.findbugs.filter.CompoundMatcher
      extended by edu.umd.cs.findbugs.filter.OrMatcher
          extended by edu.umd.cs.findbugs.filter.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

Field Summary
 
Fields inherited from class edu.umd.cs.findbugs.filter.CompoundMatcher
children
 
Constructor Summary
Filter()
          Constructor for empty filter
Filter(java.lang.String fileName)
          Constructor.
 
Method Summary
 void addChild(Matcher child)
           
 void clear()
           
 boolean contains(Matcher child)
           
 void disable(Matcher m)
           
 void enable(Matcher m)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isEmpty()
           
 boolean isEnabled(Matcher m)
           
static void main(java.lang.String[] argv)
           
 boolean match(BugInstance bugInstance)
          Determine whether or not the given BugInstance has the feature this Matcher tests for.
static Filter parseFilter(java.lang.String fileName)
           
 void removeChild(Matcher child)
           
 void setEnabled(Matcher m, boolean value)
           
 void softAdd(Matcher child)
          Add if not present, but do not enable if already present and disabled
 void writeAsXML(java.io.OutputStream out)
           
 void writeBodyAsXML(XMLOutput xmlOutput)
           
 void writeEnabledMatchersAsXML(java.io.OutputStream out)
           
 
Methods inherited from class edu.umd.cs.findbugs.filter.OrMatcher
toString, writeXML
 
Methods inherited from class edu.umd.cs.findbugs.filter.CompoundMatcher
childIterator, getChildren, numberChildren, writeChildrenXML
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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
org.xml.sax.SAXException
FilterException
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class CompoundMatcher

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class CompoundMatcher

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 -

addChild

public void addChild(Matcher child)
Overrides:
addChild in class CompoundMatcher

removeChild

public void removeChild(Matcher child)
Overrides:
removeChild in class CompoundMatcher

clear

public void clear()
Overrides:
clear in class CompoundMatcher

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

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.