edu.umd.cs.findbugs.filter
Class Filter
java.lang.Object
edu.umd.cs.findbugs.filter.CompoundMatcher
edu.umd.cs.findbugs.filter.OrMatcher
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
Constructor Summary |
Filter()
Constructor for empty filter |
Filter(java.lang.String fileName)
Constructor. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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
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™ is licenced under the LGPL. Copyright © 2006 University of Maryland.