Class SuppressionXpathFilter
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.filters.SuppressionXpathFilter
-
- All Implemented Interfaces:
Configurable,Contextualizable,ExternalResourceHolder,TreeWalkerFilter
public class SuppressionXpathFilter extends AutomaticBean implements TreeWalkerFilter, ExternalResourceHolder
This filter accepts TreeWalkerAuditEvents according to file, check and xpath query, as specified in a suppression file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
-
Constructor Summary
Constructors Constructor Description SuppressionXpathFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(TreeWalkerAuditEvent treeWalkerAuditEvent)Determines whether or not a filteredTreeWalkerAuditEventis accepted.booleanequals(java.lang.Object obj)protected voidfinishLocalSetup()Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.java.util.Set<java.lang.String>getExternalResourceLocations()Returns a set of external configuration resource locations which are used by the module.inthashCode()voidsetFile(java.lang.String fileName)Sets name of the suppression file.voidsetOptional(boolean optional)Sets whether config file existence is optional.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Method Detail
-
setFile
public void setFile(java.lang.String fileName)
Sets name of the suppression file.- Parameters:
fileName- name of the suppressions file.
-
setOptional
public void setOptional(boolean optional)
Sets whether config file existence is optional.- Parameters:
optional- tells if config file existence is optional.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
accept
public boolean accept(TreeWalkerAuditEvent treeWalkerAuditEvent)
Description copied from interface:TreeWalkerFilterDetermines whether or not a filteredTreeWalkerAuditEventis accepted.- Specified by:
acceptin interfaceTreeWalkerFilter- Parameters:
treeWalkerAuditEvent- the TreeWalkerAuditEvent to filter.- Returns:
- true if the event is accepted.
-
getExternalResourceLocations
public java.util.Set<java.lang.String> getExternalResourceLocations()
Description copied from interface:ExternalResourceHolderReturns a set of external configuration resource locations which are used by the module. ATTENTION! If 'getExternalResourceLocations()' return null, there will beNullPointerExceptioninChecker. Such behaviour will signal that your module (check or filter) is designed incorrectly. It make sense to return an empty set from 'getExternalResourceLocations()' only for composite modules likeTreeWalker.- Specified by:
getExternalResourceLocationsin interfaceExternalResourceHolder- Returns:
- a set of external configuration resource locations which are used by the module.
-
finishLocalSetup
protected void finishLocalSetup() throws CheckstyleExceptionDescription copied from class:AutomaticBeanProvides a hook to finish the part of this component's setup that was not handled by the bean introspection.The default implementation does nothing.
- Specified by:
finishLocalSetupin classAutomaticBean- Throws:
CheckstyleException- if there is a configuration error.
-
-