fix checkstyle errors

This commit is contained in:
Rick Giles 2002-11-30 17:39:27 +00:00
parent a955b402b7
commit 65ca7775ba
5 changed files with 37 additions and 9 deletions

View File

@ -43,7 +43,7 @@ public class DefaultConfiguration implements Configuration
/**
* Instantiates a DefaultConfiguration.
* @param aName
* @param aName the name for this DefaultConfiguration.
*/
public DefaultConfiguration(String aName)
{
@ -71,7 +71,8 @@ public class DefaultConfiguration implements Configuration
/** @see Configuration */
public Configuration[] getChildren()
{
return (Configuration[]) mChildren.toArray(new Configuration[mChildren.size()]);
return (Configuration[]) mChildren.toArray(
new Configuration[mChildren.size()]);
}
/** @see Configuration */
@ -80,11 +81,20 @@ public class DefaultConfiguration implements Configuration
return mName;
}
/**
* Makes a configuration a child of this configuration.
* @param aConfiguration the child configuration.
*/
public void addChild(Configuration aConfiguration)
{
mChildren.add(aConfiguration);
}
/**
* Adds an attribute to this configuration.
* @param aName the name of the attribute.
* @param aValue the value of the attribute.
*/
public void addAttribute(String aName, String aValue)
{
mAttributeMap.put(aName, aValue);

View File

@ -44,6 +44,7 @@ import org.apache.commons.beanutils.converters.StringArrayConverter;
/**
* A Java Bean that implements the component lifecycle interfaces by
* calling the bean's setters for all configration attributes.
* @author lkuehne
*/
public class AutomaticBean
implements Configurable, Contextualizable
@ -129,16 +130,21 @@ public class AutomaticBean
}
catch (InvocationTargetException e) {
throw new CheckstyleException(
"for " + aConfiguration.getName() + " unable to set " + key
+ " with " + value);
"for " + aConfiguration.getName() + " unable to set "
+ key + " with " + value);
}
catch (IllegalAccessException e) {
throw new CheckstyleException(
"cannot access " + key + " in " + this.getClass().getName());
"cannot access " + key + " in "
+ this.getClass().getName());
}
}
}
/**
* Implements the Contextualizable interface using bean introspection.
* @see Contextualizable
*/
public void contextualize(Context aContext)
throws CheckstyleException
{
@ -157,7 +163,8 @@ public class AutomaticBean
}
catch (IllegalAccessException e) {
throw new CheckstyleException(
"cannot access " + key + " in " + this.getClass().getName());
"cannot access " + key + " in "
+ this.getClass().getName());
}
}
}

View File

@ -28,7 +28,8 @@ public interface Configurable
{
/**
* Configures this component.
* @param aConfiguration the configuration to use
* @param aConfiguration the configuration to use.
* @throws CheckstyleException if there is a configuration error.
*/
void configure(Configuration aConfiguration) throws CheckstyleException;
}

View File

@ -27,7 +27,16 @@ package com.puppycrawl.tools.checkstyle.api;
*/
public interface Context
{
Object get(String key);
/**
* Searches for the value with the specified attribute key in this context.
* @param aKey the attribute key.
* @return the value in this context with the specified attribute key value.
*/
Object get(String aKey);
/**
* Returns the names of all atttributes of this context.
* @return the names of all atttributes of this context.
*/
String[] getAttributeNames();
}

View File

@ -31,7 +31,8 @@ public interface Contextualizable
{
/**
* Sets the context for this Component.
* @param aContext the context
* @param aContext the context.
* @throws CheckstyleException if there is a contextualization error.
*/
void contextualize(Context aContext) throws CheckstyleException;
}