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
Filter to match a subset of BugInstances. The filter criteria are read from
an XML file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentityHashMap<Matcher, Boolean> private static final intFields inherited from class CompoundMatcher
children -
Constructor Summary
ConstructorsConstructorDescriptionFilter()Constructor for empty filterFilter(InputStream stream) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()booleanvoidvoidbooleaninthashCode()booleanisEmpty()booleanstatic voidbooleanmatch(BugInstance bugInstance) Determine whether or not the given BugInstance has the feature this Matcher tests for.private voidParse and load the given filter file.private voidparse(String fileName, InputStream stream) Parse and load the given filter file.static FilterparseFilter(String fileName) voidremoveChild(Matcher child) voidsetEnabled(Matcher m, boolean value) voidAdd if not present, but do not enable if already present and disabledvoidwriteAsXML(OutputStream out) voidwriteBodyAsXML(XMLOutput xmlOutput) voidMethods inherited from class CompoundMatcher
childIterator, getChildren, maxChildren, numberChildren, writeChildrenXML
-
Field Details
-
PRIME
private static final int PRIME- See Also:
-
disabled
-
-
Constructor Details
-
Filter
public Filter()Constructor for empty filter -
Filter
Constructor.- Parameters:
fileName- name of the filter file- Throws:
IOException
-
Filter
Constructor.- Parameters:
stream- content of the filter file- Throws:
IOException
-
-
Method Details
-
hashCode
public int hashCode()- Overrides:
hashCodein classCompoundMatcher
-
equals
- Overrides:
equalsin classCompoundMatcher
-
isEmpty
public boolean isEmpty() -
setEnabled
-
disable
-
isEnabled
-
enable
-
parseFilter
- Throws:
IOException
-
contains
-
softAdd
Add if not present, but do not enable if already present and disabled- Parameters:
child-
-
addChild
- Overrides:
addChildin classCompoundMatcher
-
removeChild
- Overrides:
removeChildin classCompoundMatcher
-
clear
public void clear()- Overrides:
clearin classCompoundMatcher
-
match
Description copied from interface:MatcherDetermine whether or not the given BugInstance has the feature this Matcher tests for. -
parse
Parse and load the given filter file.- Parameters:
fileName- name of the filter file- Throws:
IOExceptionSAXExceptionParserConfigurationException
-
parse
private void parse(String fileName, @WillClose InputStream stream) throws IOException, SAXException, ParserConfigurationException Parse and load the given filter file.- Parameters:
fileName- name of the filter file- Throws:
IOExceptionSAXExceptionParserConfigurationException
-
main
-
writeAsXML
- Throws:
IOException
-
writeEnabledMatchersAsXML
- Throws:
IOException
-
writeBodyAsXML
- Throws:
IOException
-