com.puppycrawl.tools.checkstyle.api

Class AutomaticBean

Implemented Interfaces:
Configurable, Contextualizable
Known Direct Subclasses:
AbstractViolationReporter, Checker, DefaultLogger, SeverityMatchFilter, SuppressionCommentFilter, SuppressionFilter, XMLLogger

public class AutomaticBean
extends Object
implements Configurable, Contextualizable

A Java Bean that implements the component lifecycle interfaces by calling the bean's setters for all configration attributes.
Author:
lkuehne

Method Summary

void
configure(Configuration aConfiguration)
Implements the Configurable interface using bean introspection.
void
contextualize(Context aContext)
Implements the Contextualizable interface using bean introspection.
protected void
finishLocalSetup()
Provides a hook to finish the part of this compoent's setup that was not handled by the bean introspection.
protected Configuration
getConfiguration()
Returns the configuration that was used to configure this component.
protected void
setupChild(Configuration aChildConf)
Called by configure() for every child of this component's Configuration.

Method Details

configure

public final void configure(Configuration aConfiguration)
            throws CheckstyleException
Implements the Configurable interface using bean introspection. Subclasses are allowed to add behaviour. After the bean based setup has completed first the method finishLocalSetup is called to allow completion of the bean's local setup, after that the method setupChild is called for each child Configuration of aConfiguration.
Specified by:
configure in interface Configurable
Parameters:
aConfiguration -
See Also:
Configurable

contextualize

public final void contextualize(Context aContext)
            throws CheckstyleException
Implements the Contextualizable interface using bean introspection.
Specified by:
contextualize in interface Contextualizable
Parameters:
aContext -

finishLocalSetup

protected void finishLocalSetup()
            throws CheckstyleException
Provides a hook to finish the part of this compoent's setup that was not handled by the bean introspection.

The default implementation does nothing.

Throws:
CheckstyleException - if there is a configuration error.

getConfiguration

protected final Configuration getConfiguration()
Returns the configuration that was used to configure this component.
Returns:
the configuration that was used to configure this component.

setupChild

protected void setupChild(Configuration aChildConf)
            throws CheckstyleException
Called by configure() for every child of this component's Configuration.

The default implementation does nothing.

Parameters:
aChildConf - a child of this component's Configuration
Throws:
CheckstyleException - if there is a configuration error.