com.puppycrawl.tools.checkstyle.api

Class AutomaticBean

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
voidconfigure(Configuration aConfiguration)
Implements the Configurable interface using bean introspection.
voidcontextualize(Context aContext)
Implements the Contextualizable interface using bean introspection.
protected voidfinishLocalSetup()
Provides a hook to finish the part of this compoent's setup that was not handled by the bean introspection.
protected ConfigurationgetConfiguration()
Returns the configuration that was used to configure this component.
protected voidsetupChild(Configuration aChildConf)
Called by configure() for every child of this component's Configuration.

Method Detail

configure

public final void configure(Configuration aConfiguration)
Implements the Configurable interface using bean introspection. Subclasses are allowed to add behaviour. After the bean based setup has completed first the method {@link #finishLocalSetup finishLocalSetup} is called to allow completion of the bean's local setup, after that the method {@link #setupChild setupChild} is called for each {@link Configuration#getChildren child Configuration} of aConfiguration.

Parameters: aConfiguration {@inheritDoc}

Throws: CheckstyleException {@inheritDoc}

See Also: Configurable

contextualize

public final void contextualize(Context aContext)
Implements the Contextualizable interface using bean introspection.

Parameters: aContext {@inheritDoc}

Throws: CheckstyleException {@inheritDoc}

See Also: Contextualizable

finishLocalSetup

protected void finishLocalSetup()
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)
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.

See Also: Configuration