Package 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
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 int
Fields inherited from class edu.umd.cs.findbugs.filter.CompoundMatcher
children
-
Constructor Summary
ConstructorsConstructorDescriptionFilter()
Constructor for empty filterFilter
(InputStream stream) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
boolean
void
void
boolean
int
hashCode()
boolean
isEmpty()
boolean
static void
boolean
match
(BugInstance bugInstance) Determine whether or not the given BugInstance has the feature this Matcher tests for.private void
Parse and load the given filter file.private void
parse
(String fileName, InputStream stream) Parse and load the given filter file.static Filter
parseFilter
(String fileName) void
removeChild
(Matcher child) void
setEnabled
(Matcher m, boolean value) void
Add if not present, but do not enable if already present and disabledvoid
writeAsXML
(OutputStream out) void
writeBodyAsXML
(XMLOutput xmlOutput) void
Methods inherited from class edu.umd.cs.findbugs.filter.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:
hashCode
in classCompoundMatcher
-
equals
- Overrides:
equals
in 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:
addChild
in classCompoundMatcher
-
removeChild
- Overrides:
removeChild
in classCompoundMatcher
-
clear
public void clear()- Overrides:
clear
in classCompoundMatcher
-
match
Description copied from interface:Matcher
Determine 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:
IOException
SAXException
ParserConfigurationException
-
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:
IOException
SAXException
ParserConfigurationException
-
main
-
writeAsXML
- Throws:
IOException
-
writeEnabledMatchersAsXML
- Throws:
IOException
-
writeBodyAsXML
- Throws:
IOException
-