Class AutomaticBean
java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
- All Implemented Interfaces:
Configurable,Contextualizable
- Direct Known Subclasses:
AbstractViolationReporter,BeforeExecutionExclusionFileFilter,Checker,DefaultLogger,SeverityMatchFilter,SuppressionCommentFilter,SuppressionFilter,SuppressionSingleFilter,SuppressionXpathFilter,SuppressionXpathSingleFilter,SuppressWarningsFilter,SuppressWithNearbyCommentFilter,SuppressWithPlainTextCommentFilter,XMLLogger,XpathFileGeneratorAstFilter,XpathFileGeneratorAuditListener
A Java Bean that implements the component lifecycle interfaces by
calling the bean's setters for all configuration attributes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum to specify behaviour regarding ignored modules. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidconfigure(Configuration config) Implements the Configurable interface using bean introspection.final voidcontextualize(Context context) Implements the Contextualizable interface using bean introspection.protected abstract voidProvides a hook to finish the part of this component's setup that was not handled by the bean introspection.protected final ConfigurationReturns the configuration that was used to configure this component.protected voidsetupChild(Configuration childConf) Called by configure() for every child of this component's Configuration.
-
Constructor Details
-
AutomaticBean
public AutomaticBean()
-
-
Method Details
-
finishLocalSetup
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.The default implementation does nothing.
- Throws:
CheckstyleException- if there is a configuration error.
-
configure
Implements the Configurable interface using bean introspection.Subclasses are allowed to add behaviour. After the bean based setup has completed first the method
finishLocalSetupis called to allow completion of the bean's local setup, after that the methodsetupChildis called for eachchild Configurationofconfiguration.- Specified by:
configurein interfaceConfigurable- Parameters:
config- the configuration to use.- Throws:
CheckstyleException- if there is a configuration error.- See Also:
-
contextualize
Implements the Contextualizable interface using bean introspection.- Specified by:
contextualizein interfaceContextualizable- Parameters:
context- the context.- Throws:
CheckstyleException- if there is a contextualization error.- See Also:
-
getConfiguration
Returns the configuration that was used to configure this component.- Returns:
- the configuration that was used to configure this component.
-
setupChild
Called by configure() for every child of this component's Configuration.The default implementation throws
CheckstyleExceptionifchildConfisnullbecause it doesn't support children. It must be overridden to validate and support children that are wanted.- Parameters:
childConf- a child of this component's Configuration- Throws:
CheckstyleException- if there is a configuration error.- See Also:
-